From patchwork Tue Mar 10 23:23:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Dykstra X-Patchwork-Id: 24269 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id E6CC2DE05F for ; Wed, 11 Mar 2009 10:23:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755524AbZCJXXY (ORCPT ); Tue, 10 Mar 2009 19:23:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755098AbZCJXXY (ORCPT ); Tue, 10 Mar 2009 19:23:24 -0400 Received: from mail-fx0-f176.google.com ([209.85.220.176]:46733 "EHLO mail-fx0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754984AbZCJXXX (ORCPT ); Tue, 10 Mar 2009 19:23:23 -0400 Received: by fxm24 with SMTP id 24so1800861fxm.37 for ; Tue, 10 Mar 2009 16:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=/z+EwN/HtpwnJJh3+WTQuoybj5IvxVWJy0iJEZiB8+U=; b=jFkBOuzWzLycETcRedvGv+peq08yKGSs2kS1XZVxC028bROzu8OioSK9Y4DhV8MsZq ZwSISqcZ3xf9lfvPQ+gl1u/nPgO2VKvyW32uFrGtp1J2ocO8NciMb3/rflpAnTakTRSc ggxcEzqjDNvwpZI1r89OCpqK6PWZ5kO6iE7BU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=DGVCWPlSJyermws4NZ1Cd2omdyoN4KN7wM2tvAaRT0fDpbgjEV/P3JeIFO+UK+ISN/ Nq4lQX7pn5BnyWHToTmuMnpUBfU9ehP/mt855PKJJ8ORmJfHIfbhMTTbHAHHU0sUfIf6 pVUyLY6gG5jAN0TjTGNZl4xUPO5X1wsfl0B4I= Received: by 10.103.11.7 with SMTP id o7mr3515958mui.103.1236727398992; Tue, 10 Mar 2009 16:23:18 -0700 (PDT) Received: from ?192.168.221.201? (c-24-118-80-156.hsd1.mn.comcast.net [24.118.80.156]) by mx.google.com with ESMTPS id j2sm11720426mue.54.2009.03.10.16.23.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Mar 2009 16:23:18 -0700 (PDT) Subject: Re: BUG when unloading bonding on 2.6.29-rc7-git3 From: John Dykstra To: Thomas Backlund Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org In-Reply-To: <49B6CA4A.2040506@mandriva.org> References: <49B6CA4A.2040506@mandriva.org> Date: Tue, 10 Mar 2009 23:23:13 +0000 Message-Id: <1236727393.7958.38.camel@Maple> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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: [] > 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. Acked-by: Brian Haley --- 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 Signed-off-by: John Dykstra --- 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 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 */