From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Tan Xiaojun <tanxiaojun@huawei.com>,
Ding Tianhong <dingtianhong@huawei.com>,
"David S. Miller" <davem@davemloft.net>
Subject: [ 25/45] dummy: fix oops when loading the dummy failed
Date: Fri, 26 Jul 2013 13:57:45 -0700 [thread overview]
Message-ID: <20130726205657.648981907@linuxfoundation.org> (raw)
In-Reply-To: <20130726205654.896050165@linuxfoundation.org>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: dingtianhong <dingtianhong@huawei.com>
[ Upstream commit 2c8a01894a12665d8059fad8f0a293c98a264121 ]
We rename the dummy in modprobe.conf like this:
install dummy0 /sbin/modprobe -o dummy0 --ignore-install dummy
install dummy1 /sbin/modprobe -o dummy1 --ignore-install dummy
We got oops when we run the command:
modprobe dummy0
modprobe dummy1
------------[ cut here ]------------
[ 3302.187584] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[ 3302.195411] IP: [<ffffffff813fe62a>] __rtnl_link_unregister+0x9a/0xd0
[ 3302.201844] PGD 85c94a067 PUD 8517bd067 PMD 0
[ 3302.206305] Oops: 0002 [#1] SMP
[ 3302.299737] task: ffff88105ccea300 ti: ffff880eba4a0000 task.ti: ffff880eba4a0000
[ 3302.307186] RIP: 0010:[<ffffffff813fe62a>] [<ffffffff813fe62a>] __rtnl_link_unregister+0x9a/0xd0
[ 3302.316044] RSP: 0018:ffff880eba4a1dd8 EFLAGS: 00010246
[ 3302.321332] RAX: 0000000000000000 RBX: ffffffff81a9d738 RCX: 0000000000000002
[ 3302.328436] RDX: 0000000000000000 RSI: ffffffffa04d602c RDI: ffff880eba4a1dd8
[ 3302.335541] RBP: ffff880eba4a1e18 R08: dead000000200200 R09: dead000000100100
[ 3302.342644] R10: 0000000000000080 R11: 0000000000000003 R12: ffffffff81a9d788
[ 3302.349748] R13: ffffffffa04d7020 R14: ffffffff81a9d670 R15: ffff880eba4a1dd8
[ 3302.364910] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 3302.370630] CR2: 0000000000000008 CR3: 000000085e15e000 CR4: 00000000000427e0
[ 3302.377734] DR0: 0000000000000003 DR1: 00000000000000b0 DR2: 0000000000000001
[ 3302.384838] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 3302.391940] Stack:
[ 3302.393944] ffff880eba4a1dd8 ffff880eba4a1dd8 ffff880eba4a1e18 ffffffffa04d70c0
[ 3302.401350] 00000000ffffffef ffffffffa01a8000 0000000000000000 ffffffff816111c8
[ 3302.408758] ffff880eba4a1e48 ffffffffa01a80be ffff880eba4a1e48 ffffffffa04d70c0
[ 3302.416164] Call Trace:
[ 3302.418605] [<ffffffffa01a8000>] ? 0xffffffffa01a7fff
[ 3302.423727] [<ffffffffa01a80be>] dummy_init_module+0xbe/0x1000 [dummy0]
[ 3302.430405] [<ffffffffa01a8000>] ? 0xffffffffa01a7fff
[ 3302.435535] [<ffffffff81000322>] do_one_initcall+0x152/0x1b0
[ 3302.441263] [<ffffffff810ab24b>] do_init_module+0x7b/0x200
[ 3302.446824] [<ffffffff810ad3d2>] load_module+0x4e2/0x530
[ 3302.452215] [<ffffffff8127ae40>] ? ddebug_dyndbg_boot_param_cb+0x60/0x60
[ 3302.458979] [<ffffffff810ad5f1>] SyS_init_module+0xd1/0x130
[ 3302.464627] [<ffffffff814b9652>] system_call_fastpath+0x16/0x1b
[ 3302.490090] RIP [<ffffffff813fe62a>] __rtnl_link_unregister+0x9a/0xd0
[ 3302.496607] RSP <ffff880eba4a1dd8>
[ 3302.500084] CR2: 0000000000000008
[ 3302.503466] ---[ end trace 8342d49cd49f78ed ]---
The reason is that when loading dummy, if __rtnl_link_register() return failed,
the init_module should return and avoid take the wrong path.
Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/dummy.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -186,6 +186,8 @@ static int __init dummy_init_module(void
rtnl_lock();
err = __rtnl_link_register(&dummy_link_ops);
+ if (err < 0)
+ goto out;
for (i = 0; i < numdummies && !err; i++) {
err = dummy_init_one();
@@ -193,6 +195,8 @@ static int __init dummy_init_module(void
}
if (err < 0)
__rtnl_link_unregister(&dummy_link_ops);
+
+out:
rtnl_unlock();
return err;
next prev parent reply other threads:[~2013-07-26 21:06 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 20:57 [ 00/45] 3.0.88-stable review Greg Kroah-Hartman
2013-07-26 20:57 ` [ 01/45] tick: Prevent uncontrolled switch to oneshot mode Greg Kroah-Hartman
2013-07-26 20:57 ` [ 02/45] ASoC: sglt5000: Fix SGTL5000_PLL_FRAC_DIV_MASK Greg Kroah-Hartman
2013-07-26 20:57 ` [ 03/45] rt2x00: read 5GHz TX power values from the correct offset Greg Kroah-Hartman
2013-07-26 20:57 ` [ 04/45] SCSI: zfcp: fix adapter (re)open recovery while link to SAN is down Greg Kroah-Hartman
2013-07-26 20:57 ` [ 05/45] SCSI: mpt2sas: fix firmware failure with wrong task attribute Greg Kroah-Hartman
2013-07-26 20:57 ` [ 06/45] tracing: Use current_uid() for critical time tracing Greg Kroah-Hartman
2013-07-26 20:57 ` [ 07/45] perf: Clone child context from parent context pmu Greg Kroah-Hartman
2013-07-26 20:57 ` [ 08/45] perf: Remove WARN_ON_ONCE() check in __perf_event_enable() for valid scenario Greg Kroah-Hartman
2013-07-26 20:57 ` [ 09/45] perf: Fix perf_lock_task_context() vs RCU Greg Kroah-Hartman
2013-07-26 20:57 ` [ 10/45] sparc32: vm_area_struct access for old Sun SPARCs Greg Kroah-Hartman
2013-07-26 20:57 ` [ 11/45] sparc64 address-congruence property Greg Kroah-Hartman
2013-07-26 20:57 ` [ 12/45] sparc: tsb must be flushed before tlb Greg Kroah-Hartman
2013-07-26 20:57 ` [ 13/45] bridge: fix switched interval for MLD Query types Greg Kroah-Hartman
2013-07-26 20:57 ` [ 14/45] ipv6: dont call addrconf_dst_alloc again when enable lo Greg Kroah-Hartman
2013-07-26 20:57 ` [ 15/45] ipv6: ip6_sk_dst_check() must not assume ipv6 dst Greg Kroah-Hartman
2013-07-26 20:57 ` [ 16/45] af_key: fix info leaks in notify messages Greg Kroah-Hartman
2013-07-26 20:57 ` [ 17/45] neighbour: fix a race in neigh_destroy() Greg Kroah-Hartman
2013-07-26 20:57 ` [ 18/45] x25: Fix broken locking in ioctl error paths Greg Kroah-Hartman
2013-07-26 20:57 ` [ 19/45] net: Swap ver and type in pppoe_hdr Greg Kroah-Hartman
2013-07-26 20:57 ` [ 20/45] ipv6,mcast: always hold idev->lock before mca_lock Greg Kroah-Hartman
2013-07-26 20:57 ` [ 21/45] l2tp: add missing .owner to struct pppox_proto Greg Kroah-Hartman
2013-07-26 20:57 ` [ 22/45] ipv6: call udp_push_pending_frames when uncorking a socket with AF_INET pending data Greg Kroah-Hartman
2013-07-26 20:57 ` [ 23/45] sunvnet: vnet_port_remove must call unregister_netdev Greg Kroah-Hartman
2013-07-26 20:57 ` [ 24/45] ifb: fix rcu_sched self-detected stalls Greg Kroah-Hartman
2013-07-26 20:57 ` Greg Kroah-Hartman [this message]
2013-07-26 20:57 ` [ 26/45] ifb: fix oops when loading the ifb failed Greg Kroah-Hartman
2013-07-26 20:57 ` [ 27/45] vlan: fix a race in egress prio management Greg Kroah-Hartman
2013-07-26 20:57 ` [ 28/45] writeback: Fix periodic writeback after fs mount Greg Kroah-Hartman
2013-07-26 20:57 ` [ 29/45] SCSI: megaraid_sas: fix memory leak if SGL has zero length entries Greg Kroah-Hartman
2013-07-26 20:57 ` [ 30/45] SCSI: Fix incorrect memset in bnx2fc_parse_fcp_rsp Greg Kroah-Hartman
2013-07-26 20:57 ` [ 31/45] usb: serial: option: blacklist ONDA MT689DC QMI interface Greg Kroah-Hartman
2013-07-26 20:57 ` [ 32/45] usb: option: add TP-LINK MA260 Greg Kroah-Hartman
2013-07-26 20:57 ` [ 33/45] usb: serial: option: add Olivetti Olicard 200 Greg Kroah-Hartman
2013-07-26 20:57 ` [ 34/45] usb: serial: option.c: remove ONDA MT825UP product ID fromdriver Greg Kroah-Hartman
2013-07-26 20:57 ` [ 35/45] USB: option: append Petatel NP10T device to GSM modems list Greg Kroah-Hartman
2013-07-26 20:57 ` [ 36/45] USB: option: add D-Link DWM-152/C1 and DWM-156/C1 Greg Kroah-Hartman
2013-07-26 20:57 ` [ 37/45] usb: serial: option: Add ONYX 3G device support Greg Kroah-Hartman
2013-07-26 20:57 ` [ 38/45] usb: serial: cp210x: Add USB ID for Netgear Switches embedded serial adapter Greg Kroah-Hartman
2013-07-26 20:57 ` [ 39/45] USB: cp210x: add MMB and PI ZigBee USB Device Support Greg Kroah-Hartman
2013-07-26 20:58 ` [ 40/45] usb: cp210x support SEL C662 Vendor/Device Greg Kroah-Hartman
2013-07-26 20:58 ` [ 41/45] lockd: protect nlm_blocked access in nlmsvc_retry_blocked Greg Kroah-Hartman
2013-07-26 20:58 ` [ 42/45] tracing: Fix irqs-off tag display in syscall tracing Greg Kroah-Hartman
2013-07-26 20:58 ` [ 43/45] hrtimers: Move SMP function call to thread context Greg Kroah-Hartman
2013-07-26 20:58 ` [ 44/45] [SCSI] zfcp: status read buffers on first adapter open with link down Greg Kroah-Hartman
2013-07-26 20:58 ` [ 45/45] ALSA: usb-audio: 6fire: return correct XRUN indication Greg Kroah-Hartman
2013-07-27 11:22 ` [ 00/45] 3.0.88-stable review linux
2013-07-27 23:30 ` Ben Hutchings
2013-07-28 1:31 ` Guenter Roeck
2013-07-28 18:39 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130726205657.648981907@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=dingtianhong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tanxiaojun@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox