netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] genetlink: Fix generic netlink family unregister
@ 2016-10-28 23:01 Pravin B Shelar
  2016-10-28 23:24 ` Johannes Berg
  2016-10-30  0:58 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Pravin B Shelar @ 2016-10-28 23:01 UTC (permalink / raw)
  To: netdev; +Cc: Pravin B Shelar, Johannes Berg

This patch fixes a typo in unregister operation.

Following crash is fixed by this patch. It can be easily reproduced
by repeating modprobe and rmmod module that uses genetlink.

[  261.446686] BUG: unable to handle kernel paging request at ffffffffa0264088
[  261.448921] IP: [<ffffffff813cb70e>] strcmp+0xe/0x30
[  261.450494] PGD 1c09067
[  261.451266] PUD 1c0a063
[  261.452091] PMD 8068d5067
[  261.452525] PTE 0
[  261.453164]
[  261.453618] Oops: 0000 [#1] SMP
[  261.454577] Modules linked in: openvswitch(+) ...
[  261.480753] RIP: 0010:[<ffffffff813cb70e>]  [<ffffffff813cb70e>] strcmp+0xe/0x30
[  261.483069] RSP: 0018:ffffc90003c0bc28  EFLAGS: 00010282
[  261.510145] Call Trace:
[  261.510896]  [<ffffffff816f10ca>] genl_family_find_byname+0x5a/0x70
[  261.512819]  [<ffffffff816f2319>] genl_register_family+0xb9/0x630
[  261.514805]  [<ffffffffa02840bc>] dp_init+0xbc/0x120 [openvswitch]
[  261.518268]  [<ffffffff8100217d>] do_one_initcall+0x3d/0x160
[  261.525041]  [<ffffffff811808a9>] do_init_module+0x60/0x1f1
[  261.526754]  [<ffffffff8110687f>] load_module+0x22af/0x2860
[  261.530144]  [<ffffffff81107026>] SYSC_finit_module+0x96/0xd0
[  261.531901]  [<ffffffff8110707e>] SyS_finit_module+0xe/0x10
[  261.533605]  [<ffffffff8100391e>] do_syscall_64+0x6e/0x180
[  261.535284]  [<ffffffff817c2faf>] entry_SYSCALL64_slow_path+0x25/0x25
[  261.546512] RIP  [<ffffffff813cb70e>] strcmp+0xe/0x30
[  261.550198] ---[ end trace 76505a814dd68770 ]---

Fixes: 2ae0f17df1c ("genetlink: use idr to track families").

Reported-by: Jarno Rajahalme <jarno@ovn.org>
CC: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
---
 net/netlink/genetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index df0cbcd..caf04d7 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -399,7 +399,7 @@ int genl_unregister_family(const struct genl_family *family)
 {
 	genl_lock_all();
 
-	if (genl_family_find_byid(family->id)) {
+	if (!genl_family_find_byid(family->id)) {
 		genl_unlock_all();
 		return -ENOENT;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] genetlink: Fix generic netlink family unregister
  2016-10-28 23:01 [PATCH net-next] genetlink: Fix generic netlink family unregister Pravin B Shelar
@ 2016-10-28 23:24 ` Johannes Berg
  2016-10-30  0:58 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2016-10-28 23:24 UTC (permalink / raw)
  To: Pravin B Shelar, netdev

On Fri, 2016-10-28 at 16:01 -0700, Pravin B Shelar wrote:
> This patch fixes a typo in unregister operation.
> 
> Following crash is fixed by this patch. It can be easily reproduced
> by repeating modprobe and rmmod module that uses genetlink.

Yikes, I ran all my tests in VMs and forgot this wasn't even executed.
Sorry about that!

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

johannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] genetlink: Fix generic netlink family unregister
  2016-10-28 23:01 [PATCH net-next] genetlink: Fix generic netlink family unregister Pravin B Shelar
  2016-10-28 23:24 ` Johannes Berg
@ 2016-10-30  0:58 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-10-30  0:58 UTC (permalink / raw)
  To: pshelar; +Cc: netdev, johannes

From: Pravin B Shelar <pshelar@ovn.org>
Date: Fri, 28 Oct 2016 16:01:41 -0700

> This patch fixes a typo in unregister operation.
> 
> Following crash is fixed by this patch. It can be easily reproduced
> by repeating modprobe and rmmod module that uses genetlink.
 ...
> Fixes: 2ae0f17df1c ("genetlink: use idr to track families").
> 
> Reported-by: Jarno Rajahalme <jarno@ovn.org>
> CC: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Pravin B Shelar <pshelar@ovn.org>

Applied, thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-30  0:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28 23:01 [PATCH net-next] genetlink: Fix generic netlink family unregister Pravin B Shelar
2016-10-28 23:24 ` Johannes Berg
2016-10-30  0:58 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).