Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

time/jiffies: Fix sysctl file error on configurations where USER_HZ < HZ

Commit 2dc164a48e6fd ("sysctl: Create converter functions with two new
macros") incorrectly returns error to user space when jiffies sysctl
converter is used. The old overflow check got replaced with an
unconditional one:
+ if (USER_HZ < HZ)
+ return -EINVAL;
which will always be true on configurations with "USER_HZ < HZ".

Remove the check; it is no longer needed as clock_t_to_jiffies() returns
ULONG_MAX for the overflow case and proc_int_u2k_conv_uop() checks for
"> INT_MAX" after conversion

Fixes: 2dc164a48e6fd ("sysctl: Create converter functions with two new macros")
Reported-by: Colm Harrington <colm.harrington@oracle.com>
Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>

authored by

Gerd Rausch and committed by
Joel Granados
6932256d 11439c46

-2
-2
kernel/time/jiffies.c
··· 256 256 int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int dir, 257 257 void *buffer, size_t *lenp, loff_t *ppos) 258 258 { 259 - if (SYSCTL_USER_TO_KERN(dir) && USER_HZ < HZ) 260 - return -EINVAL; 261 259 return proc_dointvec_conv(table, dir, buffer, lenp, ppos, 262 260 do_proc_int_conv_userhz_jiffies); 263 261 }