diff mbox

BUG when unloading bonding on 2.6.29-rc7-git3

Message ID 1236727393.7958.38.camel@Maple
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

John Dykstra March 10, 2009, 11:23 p.m. UTC
On Tue, 2009-03-10 at 22:15 +0200, Thomas Backlund wrote:
> I get this when trying to unloading the bonding module by doing:
> 
> service network stop
> modprobe -r bonding
> 
> Oh, and I have "options ipv6 disable=1" in /etc/modprobe.conf
> 
> 
> > Mar 10 21:43:33 tmb kernel: BUG: unable to handle kernel NULL
> pointer dereference at 0000000000000028
> > Mar 10 21:43:33 tmb kernel: IP: [<ffffffffa038ad6b>]
> ipv6_sysctl_net_exit+0x1b/0x60 [ipv6]

Beyond the null pointer reference in ipv6_sysctl_net_exit caught in the
report, there is at least one further place where ipv6 module exit
breaks with disable=1. 

I've tested this patch with both values of the module parameter, and
with IPv6 built into the kernel rather than as a module.  I cannot
guarantee that something else doesn't break when modules call into an
unitialized ipv6.

---

ipv6:  Fix BUG when disabled ipv6 module is unloaded

Do not try to "uninitialize" ipv6 if its initialization had been skipped
because module parameter disable=1 had been specified.

Reported-by:  Thomas Backlund <tmb@mandriva.org>
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
---
net/ipv6/af_inet6.c |    3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

--
1.5.4.3


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Brian Haley March 11, 2009, 2:47 p.m. UTC | #1
John Dykstra wrote:
> ipv6:  Fix BUG when disabled ipv6 module is unloaded
> 
> Do not try to "uninitialize" ipv6 if its initialization had been skipped
> because module parameter disable=1 had been specified.
> 
> Reported-by:  Thomas Backlund <tmb@mandriva.org>
> Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
> ---
> net/ipv6/af_inet6.c |    3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
> index da944ec..a0f1798 100644
> --- a/net/ipv6/af_inet6.c
> +++ b/net/ipv6/af_inet6.c
> @@ -1192,6 +1192,9 @@ module_init(inet6_init);
> 
> static void __exit inet6_exit(void)
> {
> +       if (disable_ipv6)
> +               return;
> +
>         /* First of all disallow new sockets creation. */
>         sock_unregister(PF_INET6);
>         /* Disallow any further netlink messages */

Acked-by: Brian Haley <brian.haley@hp.com>

Thanks for fixing this John.

Sorry, this was in the original patch I tested here, but somehow didn't make it
into what I sent to Dave.

-Brian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 11, 2009, 4:22 p.m. UTC | #2
From: John Dykstra <john.dykstra1@gmail.com>
Date: Tue, 10 Mar 2009 23:23:13 +0000

> ipv6:  Fix BUG when disabled ipv6 module is unloaded
> 
> Do not try to "uninitialize" ipv6 if its initialization had been skipped
> because module parameter disable=1 had been specified.
> 
> Reported-by:  Thomas Backlund <tmb@mandriva.org>
> Signed-off-by: John Dykstra <john.dykstra1@gmail.com>

I'm going to apply this by hand.

But if you are going to submit patches in the future you have to fix
the corruptions and mangling that your email client does to them.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index da944ec..a0f1798 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -1192,6 +1192,9 @@  module_init(inet6_init);

static void __exit inet6_exit(void)
{
+       if (disable_ipv6)
+               return;
+
        /* First of all disallow new sockets creation. */
        sock_unregister(PF_INET6);
        /* Disallow any further netlink messages */