[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] AX.25: Fix sysctl registration if !CONFIG_AX25_DAMA_SLAVE



Hello,

i'd like to inform you about an upstream fix to the kernel for the
kernel-ax25 code (see below).

With 2.6.24, the /proc code has changed. This broke /proc/sys/net/ax25/...
if the config "CONFIG_AX25_DAMA_SLAVE is not set", as it is in ubuntu.

Ubuntu hardy ships with 2.6.24 and is affected.
Thus /proc/sys/ax25 is not present.

The hot-fix without patch could be CONFIG_AX25_DAMA_SLAVE=y, because then
the referenced function to the proc interface is not missing.

I tend to think it could be a good idea anyway to set CONFIG_AX25_DAMA_SLAVE=y.
This option compiles support for DAMA into the kernel, but it still has
to be enabled via /proc. Just being capable to do DAMA does not harm.
Without this option, users who require DAMA need to recompile the kernel -
which most users nowadays won't. DAMA Slave is user requirement for users in
some areas..

I'm not sure why this option is not set in debian and ubuntu kernels,
bat i assume it is for historical reasons (a little bit lesser RAM in use).

vy 73,
	- Thomas Osterried  dl9sau

dmesg:

[   96.653046] sysctl table check failed:  .3.9.1.14 No procname
[   96.658329] Pid: 4970, comm: ifconfig Not tainted 2.6.24-19-generic #1
[   96.658387]  [<c01459c5>] set_fail+0x45/0x60
[   96.658452]  [<c0145d34>] sysctl_check_table+0x354/0x5b0
[   96.658528]  [<c0145c8a>] sysctl_check_table+0x2aa/0x5b0
[   96.658605]  [<c0145c8a>] sysctl_check_table+0x2aa/0x5b0
[   96.658631]  [<c0134228>] sysctl_head_finish+0x18/0x30
[   96.658709]  [<c0145c8a>] sysctl_check_table+0x2aa/0x5b0
[   96.658734]  [<c0132da9>] sysctl_set_parent+0x19/0x30
[   96.658805]  [<c01345d0>] register_sysctl_table+0x50/0xa0
[   96.658848]  [<fab2659e>] ax25_register_sysctl+0xfe/0x150 [ax25]
[   96.658941]  [<fab239f4>] ax25_device_event+0xd4/0xe0 [ax25]
[   96.659005]  [<c031e720>] notifier_call_chain+0x30/0x60
[   96.659067]  [<c0145407>] raw_notifier_call_chain+0x17/0x20
[   96.659105]  [<c02aaf37>] dev_open+0x77/0x80
[   96.659135]  [<c02a9ab1>] dev_change_flags+0x81/0x190
[   96.659169]  [<c02a80f4>] __dev_get_by_name+0x74/0x90
[   96.659214]  [<c02f4825>] devinet_ioctl+0x505/0x6a0
[   96.659258]  [<c02aabe2>] dev_ioctl+0x292/0x500
[   96.659411]  [<c029ca1f>] sock_ioctl+0xcf/0x220
[   96.659516]  [<c029c950>] sock_ioctl+0x0/0x220
[   96.659553]  [<c019dfab>] do_ioctl+0x2b/0x90
[   96.659608]  [<c019e23e>] vfs_ioctl+0x22e/0x2b0
[   96.659664]  [<c019e316>] sys_ioctl+0x56/0x70
[   96.659708]  [<c0104442>] syscall_call+0x7/0xb
[   96.659781]  [<c0310000>] unix_stream_sendmsg+0x160/0x390
[   96.659849]  =======================
[   96.659860] sysctl table check failed:  .3.9.1.14 procname does not match binary path procname
[   96.669880] Pid: 4970, comm: ifconfig Not tainted 2.6.24-19-generic #1
[   96.669908]  [<c01459c5>] set_fail+0x45/0x60
[   96.669960]  [<c0145c76>] sysctl_check_table+0x296/0x5b0
[   96.670035]  [<c0145c8a>] sysctl_check_table+0x2aa/0x5b0
[   96.670112]  [<c0145c8a>] sysctl_check_table+0x2aa/0x5b0
[   96.670137]  [<c0134228>] sysctl_head_finish+0x18/0x30
[   96.670209]  [<c0145c8a>] sysctl_check_table+0x2aa/0x5b0
[   96.670234]  [<c0132da9>] sysctl_set_parent+0x19/0x30
[   96.670304]  [<c01345d0>] register_sysctl_table+0x50/0xa0
[   96.670348]  [<fab2659e>] ax25_register_sysctl+0xfe/0x150 [ax25]
[   96.670421]  [<fab239f4>] ax25_device_event+0xd4/0xe0 [ax25]
[   96.670485]  [<c031e720>] notifier_call_chain+0x30/0x60
[   96.670543]  [<c0145407>] raw_notifier_call_chain+0x17/0x20
[   96.670581]  [<c02aaf37>] dev_open+0x77/0x80
[   96.670608]  [<c02a9ab1>] dev_change_flags+0x81/0x190
[   96.670642]  [<c02a80f4>] __dev_get_by_name+0x74/0x90
[   96.670686]  [<c02f4825>] devinet_ioctl+0x505/0x6a0
[   96.670726]  [<c02aabe2>] dev_ioctl+0x292/0x500
[   96.670879]  [<c029ca1f>] sock_ioctl+0xcf/0x220
[   96.670911]  [<c029c950>] sock_ioctl+0x0/0x220
[   96.670948]  [<c019dfab>] do_ioctl+0x2b/0x90
[   96.670998]  [<c019e23e>] vfs_ioctl+0x22e/0x2b0
[   96.671054]  [<c019e316>] sys_ioctl+0x56/0x70
[   96.671098]  [<c0104442>] syscall_call+0x7/0xb
[   96.671169]  [<c0310000>] unix_stream_sendmsg+0x160/0x390
[   96.671235]  =======================




----- Forwarded message from Ralf Baechle <ralf@linux-mips.org> -----

Envelope-to: thomas@osterried.de
Delivery-date: Wed, 06 Aug 2008 00:37:34 +0200
X-Envelope-From: ralf@linux-mips.org
X-Envelope-To: <thomas@osterried.de>
From: Ralf Baechle <ralf@linux-mips.org>
To: "David S. Miller" <davem@davemloft.net>, stable@kernel.org
Cc: netdev@vger.kernel.org, linux-hams@vger.kernel.org,
	Thomas Osterried <thomas@osterried.de>, jann@linux-mips.org,
	Hans-Juergen Barthen <dl5di@gmx.de>
Subject: [PATCH] AX.25: Fix sysctl registration if !CONFIG_AX25_DAMA_SLAVE
X-Spam-Score:  (-2.599) BAYES_00
X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.4

Since 49ffcf8f99e8d33ec8afb450956804af518fd788
setting struct ctl_table.procname = NULL does no longer work as it used to
the way the AX.25 code is expecting it to resulting in the AX.25 sysctl
registration code to break if CONFIG_AX25_DAMA_SLAVE was not set as in some
distribution kernels.  Kernel releases from 2.6.24 are affected.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index f597987..f288fc4 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -36,6 +36,7 @@ static struct ctl_path ax25_path[] = {
 	{ .procname = "ax25", .ctl_name = NET_AX25, },
 	{ }
 };
+
 static const ctl_table ax25_param_table[] = {
 	{
 		.ctl_name	= NET_AX25_IP_DEFAULT_MODE,
@@ -167,6 +168,7 @@ static const ctl_table ax25_param_table[] = {
 		.extra1		= &min_proto,
 		.extra2		= &max_proto
 	},
+#ifdef CONFIG_AX25_DAMA_SLAVE
 	{
 		.ctl_name	= NET_AX25_DAMA_SLAVE_TIMEOUT,
 		.procname	= "dama_slave_timeout",
@@ -177,6 +179,8 @@ static const ctl_table ax25_param_table[] = {
 		.extra1		= &min_ds_timeout,
 		.extra2		= &max_ds_timeout
 	},
+#endif
+
 	{ .ctl_name = 0 }	/* that's all, folks! */
 };
 
@@ -210,16 +214,6 @@ void ax25_register_sysctl(void)
 		ax25_table[n].procname     = ax25_dev->dev->name;
 		ax25_table[n].mode         = 0555;
 
-#ifndef CONFIG_AX25_DAMA_SLAVE
-		/*
-		 * We do not wish to have a representation of this parameter
-		 * in /proc/sys/ when configured *not* to include the
-		 * AX.25 DAMA slave code, do we?
-		 */
-
-		child[AX25_VALUES_DS_TIMEOUT].procname = NULL;
-#endif
-
 		child[AX25_MAX_VALUES].ctl_name = 0;	/* just in case... */
 
 		for (k = 0; k < AX25_MAX_VALUES; k++)

----- End forwarded message -----


Reply to: