Re: [PATCH 1/2] sysctl: Refactor base paths registrations

From: Guenter Roeck
Date: Wed May 24 2023 - 09:29:16 EST


On Thu, May 18, 2023 at 06:07:04PM +0200, Joel Granados wrote:
> This is part of the general push to deprecate register_sysctl_paths and
> register_sysctl_table. The old way of doing this through
> register_sysctl_base and DECLARE_SYSCTL_BASE macro is replaced with a
> call to register_sysctl. The 5 base paths affected are: "kernel", "vm",
> "debug", "dev" and "fs".
>
> We remove the register_sysctl_base function and the DECLARE_SYSCTL_BASE
> macro since they are no longer needed.
>
> In order to quickly acertain that the paths did not actually change I
> executed `find /proc/sys/ | sha1sum` and made sure that the sha was the
> same before and after the commit.
>
> Signed-off-by: Joel Granados <j.granados@xxxxxxxxxxx>

This patch results in the following warning, seen across almost
all architectures.

sysctl table check failed: kernel/usermodehelper Not a file
sysctl table check failed: kernel/usermodehelper No proc_handler
sysctl table check failed: kernel/usermodehelper bogus .mode 0555
sysctl table check failed: kernel/keys Not a file
sysctl table check failed: kernel/keys No proc_handler
sysctl table check failed: kernel/keys bogus .mode 0555
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.4.0-rc3-next-20230524 #1
Stack : ffffffff 801aed28 80e44644 00000004 81946ba4 00000000 810d3db4 b782f641
810f0000 81269940 810f0000 810fa610 811bb193 00000001 810d3d58 00000000
00000000 00000000 810099d8 000000f2 00000001 000000f3 00000000 00000000
ffffffff 00000002 00000000 fff80000 810f0000 810099d8 00000001 ffffffea
8013bab4 8113bb14 8013caa8 80fe0000 00000000 807b9d54 00000000 81270000
...
Call Trace:
[<8010a558>] show_stack+0x38/0x118
[<80d67edc>] dump_stack_lvl+0xa4/0xf0
[<8039c8e0>] __register_sysctl_table+0x5b4/0x7a0
[<811e55e4>] __register_sysctl_init+0x30/0x68
[<811d5164>] sysctl_init_bases+0x24/0x88
[<811e517c>] proc_root_init+0x94/0xa8
[<811ccebc>] start_kernel+0x704/0x740

failed when register_sysctl kern_table to kernel

Reverting this patch alone results in build failures. Reverting this patch
as well as the second patch in the series (to avoid the build failures)
fixes the problem.

Guenter

---
bisect log:

# bad: [cf09e328589a2ed7f6c8d90f2edb697fb4f8a96b] Add linux-next specific files for 20230524
# good: [44c026a73be8038f03dbdeef028b642880cf1511] Linux 6.4-rc3
git bisect start 'HEAD' 'v6.4-rc3'
# good: [a20d8ab9e26daaeeaf971139b736981cf164ab0a] Merge branch 'for-linux-next' of git://anongit.freedesktop.org/drm/drm-misc
git bisect good a20d8ab9e26daaeeaf971139b736981cf164ab0a
# good: [2714032dfd641b22695e14efd5f9dff08a5e3245] Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
git bisect good 2714032dfd641b22695e14efd5f9dff08a5e3245
# good: [b2bc2854ec87557033538aa9290f70b9141a6653] Merge branch 'for-leds-next' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git
git bisect good b2bc2854ec87557033538aa9290f70b9141a6653
# good: [26931c8431566f9bec7d57512e4cad8ebaeb024f] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git
git bisect good 26931c8431566f9bec7d57512e4cad8ebaeb024f
# good: [669623b562b5cd308eaa58eabe8c72007dbb37e2] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
git bisect good 669623b562b5cd308eaa58eabe8c72007dbb37e2
# good: [a0ef85b20ffa65a89dc79b0a22edb80a88199939] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
git bisect good a0ef85b20ffa65a89dc79b0a22edb80a88199939
# bad: [a64335537001eb6af6e57a82317985441dafe4e7] Merge branch 'sysctl-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
git bisect bad a64335537001eb6af6e57a82317985441dafe4e7
# good: [ba3ad1554b569888f4a63a2e4a16a9009fdedd4e] Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
git bisect good ba3ad1554b569888f4a63a2e4a16a9009fdedd4e
# good: [3133f141259d7f6e0729db272f22724614472661] Merge branch 'slab/for-6.5/prandom' into slab/for-next
git bisect good 3133f141259d7f6e0729db272f22724614472661
# good: [2716d45c6fdc1ae06e83db28f58f55f7e9415643] sysctl: stop exporting register_sysctl_table
git bisect good 2716d45c6fdc1ae06e83db28f58f55f7e9415643
# good: [8ccb380db3a4bcef9ade852da8b33fdcea01c8a5] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git
git bisect good 8ccb380db3a4bcef9ade852da8b33fdcea01c8a5
# bad: [ee996cff1fb203bffc8de5c87cab6056d60df71d] sysctl: Remove register_sysctl_table
git bisect bad ee996cff1fb203bffc8de5c87cab6056d60df71d
# bad: [7eec88986dce2d85012fbe516def7a2d7d77735c] sysctl: Refactor base paths registrations
git bisect bad 7eec88986dce2d85012fbe516def7a2d7d77735c
# first bad commit: [7eec88986dce2d85012fbe516def7a2d7d77735c] sysctl: Refactor base paths registrations