netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Ensure that pneigh_lookup is protected with RTNL
@ 2007-10-15 13:38 Pavel Emelyanov
  2007-10-15 19:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2007-10-15 13:38 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

The pnigh_lookup is used to lookup proxy entries and to 
create them in case lookup failed. 

However, the "creation" code does not perform the re-lookup
after GFP_KERNEL allocation. This is done because the code
is expected to be protected with the RTNL lock, so add the 
assertion (mainly to address future questions from new network 
developers like me :) ).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index c52df85..cd3af59 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -481,6 +481,8 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl, const void *pkey,
 	if (!creat)
 		goto out;
 
+	ASSERT_RTNL();
+
 	n = kmalloc(sizeof(*n) + key_len, GFP_KERNEL);
 	if (!n)
 		goto out;


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

* Re: [PATCH] Ensure that pneigh_lookup is protected with RTNL
  2007-10-15 13:38 [PATCH] Ensure that pneigh_lookup is protected with RTNL Pavel Emelyanov
@ 2007-10-15 19:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-10-15 19:54 UTC (permalink / raw)
  To: xemul; +Cc: netdev, devel

From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 15 Oct 2007 17:38:57 +0400

> The pnigh_lookup is used to lookup proxy entries and to 
> create them in case lookup failed. 
> 
> However, the "creation" code does not perform the re-lookup
> after GFP_KERNEL allocation. This is done because the code
> is expected to be protected with the RTNL lock, so add the 
> assertion (mainly to address future questions from new network 
> developers like me :) ).
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Thanks for this patch, applied.

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

end of thread, other threads:[~2007-10-15 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-15 13:38 [PATCH] Ensure that pneigh_lookup is protected with RTNL Pavel Emelyanov
2007-10-15 19:54 ` 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).