Joel asked for a test for the negative read path fixed by
https://lore.kernel.org/r/[email protected]
These apply on sysctl-next and depend on that fix; without it 2/2 fails,
which is the point.
While writing the test I noticed that fix's changelog is incomplete: it
names proc_dointvec_jiffies() and proc_dointvec_ms_jiffies(), but
proc_dointvec_userhz_jiffies() goes through the same
proc_int_k2u_conv_kop() and is affected too. Measured on
net/ipv4/neigh/default/retrans_time at CONFIG_HZ=250, unpatched:
# echo -1 > /proc/sys/net/ipv4/neigh/default/retrans_time
# cat /proc/sys/net/ipv4/neigh/default/retrans_time
-18446742229035144246
I will correct that in the respin.
Tested in qemu at CONFIG_HZ=250 with CONFIG_TEST_SYSCTL=y, and built as
=m. 2/2 reports "not ok" without the fix and "ok" with it, and the
pass/fail counts of the other tests are unchanged either way.
Zhan Xusheng (2):
sysctl: Add jiffies converter entries to the test module
selftests: sysctl: Check the sign of a negative jiffies read
lib/test_sysctl.c | 31 ++++++++++++++++++++++++
tools/testing/selftests/sysctl/sysctl.sh | 23 ++++++++++++++++++
2 files changed, 54 insertions(+)
base-commit: c5c4ca25387e3cefd1af64edf9187546b6d06787
--
2.43.0