Commit 6932256d authored by Gerd Rausch's avatar Gerd Rausch Committed by Joel Granados
Browse files

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



Commit 2dc164a4 ("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: 2dc164a4 ("sysctl: Create converter functions with two new macros")
Reported-by: default avatarColm Harrington <colm.harrington@oracle.com>
Signed-off-by: default avatarGerd Rausch <gerd.rausch@oracle.com>
Signed-off-by: default avatarJoel Granados <joel.granados@kernel.org>
parent 11439c46
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -256,8 +256,6 @@ EXPORT_SYMBOL(proc_dointvec_jiffies);
int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int dir,
				 void *buffer, size_t *lenp, loff_t *ppos)
{
	if (SYSCTL_USER_TO_KERN(dir) && USER_HZ < HZ)
		return -EINVAL;
	return proc_dointvec_conv(table, dir, buffer, lenp, ppos,
				  do_proc_int_conv_userhz_jiffies);
}