diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2012-07-15 06:10:14 -0400 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2012-08-13 09:10:37 -0400 |
commit | 23200d032fff56acc7126c27dee300483b8c7521 (patch) | |
tree | 63522d8ff7b68cbcb4ecad2dc816aafb3cb972ba /net/caif | |
parent | 5f122294c3d5e19e5112c019872d904aa69a8ee4 (diff) |
caif: Fix access to freed pernet memory
BugLink: http://bugs.launchpad.net/bugs/1034988
[ Upstream commit 96f80d123eff05c3cd4701463786b87952a6c3ac ]
unregister_netdevice_notifier() must be called before
unregister_pernet_subsys() to avoid accessing already freed
pernet memory. This fixes the following oops when doing rmmod:
Call Trace:
[<ffffffffa0f802bd>] caif_device_notify+0x4d/0x5a0 [caif]
[<ffffffff81552ba9>] unregister_netdevice_notifier+0xb9/0x100
[<ffffffffa0f86dcc>] caif_device_exit+0x1c/0x250 [caif]
[<ffffffff810e7734>] sys_delete_module+0x1a4/0x300
[<ffffffff810da82d>] ? trace_hardirqs_on_caller+0x15d/0x1e0
[<ffffffff813517de>] ? trace_hardirqs_on_thunk+0x3a/0x3
[<ffffffff81696bad>] system_call_fastpath+0x1a/0x1f
RIP
[<ffffffffa0f7f561>] caif_get+0x51/0xb0 [caif]
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Diffstat (limited to 'net/caif')
-rw-r--r-- | net/caif/caif_dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index 5ba4366a220..804e50f18a5 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c | |||
@@ -424,9 +424,9 @@ static int __init caif_device_init(void) | |||
424 | 424 | ||
425 | static void __exit caif_device_exit(void) | 425 | static void __exit caif_device_exit(void) |
426 | { | 426 | { |
427 | unregister_pernet_subsys(&caif_net_ops); | ||
428 | unregister_netdevice_notifier(&caif_device_notifier); | 427 | unregister_netdevice_notifier(&caif_device_notifier); |
429 | dev_remove_pack(&caif_packet_type); | 428 | dev_remove_pack(&caif_packet_type); |
429 | unregister_pernet_subsys(&caif_net_ops); | ||
430 | } | 430 | } |
431 | 431 | ||
432 | module_init(caif_device_init); | 432 | module_init(caif_device_init); |