linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] sysctl: Move the u8 range check test to lib/test_sysctl.c
@ 2025-03-21 12:47 Joel Granados
  2025-03-21 12:47 ` [PATCH 1/4] sysctl: move u8 register " Joel Granados
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Joel Granados @ 2025-03-21 12:47 UTC (permalink / raw)
  To: Kees Cook, Andrew Morton, Shuah Khan, John Sperbeck
  Cc: linux-kernel, linux-fsdevel, linux-kselftest, Joel Granados

Originally introduced to sysctl-test.c by commit b5ffbd139688 ("sysctl:
move the extra1/2 boundary check of u8 to sysctl_check_table_array"), it
has been shown to lead to a panic under certain conditions related to a
dangling registration.

This series moves the u8 test to lib/test_sysctl.c where the
registration calls are kept and correctly removed on module exit. An
additional 0012 test is added to selftests/sysctl/sysctl.sh in order to
visualize the registration calls done in test_sysctl.c.

Very much related to adding tests to sysctl, the last two patches of
this series reduce the places that need to be changed when tests are
added by managing the initialization and closing of sysctl tables with a
for loop.

Comments are greatly appreciated

Signed-off-by: Joel Granados <joel.granados@kernel.org>
---
Joel Granados (4):
      sysctl: move u8 register test to lib/test_sysctl.c
      sysctl: Add 0012 to test the u8 range check
      sysctl: call sysctl tests with a for loop
      sysctl: Close test ctl_headers with a for loop

 kernel/sysctl-test.c                     |  49 ------------
 lib/test_sysctl.c                        | 133 +++++++++++++++++++++----------
 tools/testing/selftests/sysctl/sysctl.sh |  30 +++++++
 3 files changed, 122 insertions(+), 90 deletions(-)
---
base-commit: 7eb172143d5508b4da468ed59ee857c6e5e01da6
change-id: 20250321-jag-test_extra_val-40954050a1f6

Best regards,
-- 
Joel Granados <joel.granados@kernel.org>



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-04-11 12:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-21 12:47 [PATCH 0/4] sysctl: Move the u8 range check test to lib/test_sysctl.c Joel Granados
2025-03-21 12:47 ` [PATCH 1/4] sysctl: move u8 register " Joel Granados
2025-04-09 17:26   ` Kees Cook
2025-04-11 12:37     ` Joel Granados
2025-03-21 12:47 ` [PATCH 2/4] sysctl: Add 0012 to test the u8 range check Joel Granados
2025-04-09 17:27   ` Kees Cook
2025-03-21 12:47 ` [PATCH 3/4] sysctl: call sysctl tests with a for loop Joel Granados
2025-04-09 17:28   ` Kees Cook
2025-03-21 12:47 ` [PATCH 4/4] sysctl: Close test ctl_headers " Joel Granados
2025-04-09 17:29   ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).