1 Don't register empty sysctl dirs in /proc/sys.
2 They would be removed after registering some other sysctl(s) in the
3 same directory (e.g. rtc in /proc/sys/dev) and unregistering all of
4 them (then initially empty e.g. /proc/sys/dev disappears).
5 After disappearing of directory topdir ->de (for "dev") points to
6 structure which has been freed.
7 It's harmless in vanilla 2.4, but with grsecurity causes an Oops
8 on numeric sysctls referring to removed directory (even with all
9 grsecurity features disabled, only patch applied).
11 The same issue seems to exist in 2.6, and _probably_ can cause similar
14 -- Jakub Bogusz <qboosh@pld-linux.org>
16 --- linux-2.4.20/kernel/sysctl.c.orig Mon Dec 15 11:05:08 2003
17 +++ linux-2.4.20/kernel/sysctl.c Mon Dec 15 15:48:46 2003
20 extern ctl_table net_table[];
22 -static ctl_table proc_table[];
23 static ctl_table fs_table[];
24 static ctl_table debug_table[];
25 -static ctl_table dev_table[];
26 extern ctl_table random_table[];
28 static ctl_table grsecurity_table[];
31 {CTL_NET, "net", NULL, 0, 0555, net_table},
33 - {CTL_PROC, "proc", NULL, 0, 0555, proc_table},
34 {CTL_FS, "fs", NULL, 0, 0555, fs_table},
35 {CTL_DEBUG, "debug", NULL, 0, 0555, debug_table},
36 - {CTL_DEV, "dev", NULL, 0, 0555, dev_table},
44 -static ctl_table proc_table[] = {
48 static ctl_table fs_table[] = {
49 {FS_NRINODE, "inode-nr", &inodes_stat, 2*sizeof(int),
50 0444, NULL, &proc_dointvec},
55 -static ctl_table dev_table[] = {
59 extern void init_irq_proc (void);
61 void __init sysctl_init(void)