Skip to content

Commit 6932256

Browse files
gerd-rauschJoelgranados
authored andcommitted
time/jiffies: Fix sysctl file error on configurations where USER_HZ < HZ
Commit 2dc164a ("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: 2dc164a ("sysctl: Create converter functions with two new macros") Reported-by: Colm Harrington <[email protected]> Signed-off-by: Gerd Rausch <[email protected]> Signed-off-by: Joel Granados <[email protected]>
1 parent 11439c4 commit 6932256

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

kernel/time/jiffies.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ EXPORT_SYMBOL(proc_dointvec_jiffies);
256256
int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int dir,
257257
void *buffer, size_t *lenp, loff_t *ppos)
258258
{
259-
if (SYSCTL_USER_TO_KERN(dir) && USER_HZ < HZ)
260-
return -EINVAL;
261259
return proc_dointvec_conv(table, dir, buffer, lenp, ppos,
262260
do_proc_int_conv_userhz_jiffies);
263261
}

0 commit comments

Comments
 (0)