netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 3/3] x25_create initializing socket data twice
@ 2005-03-04 12:37 akpm
  2005-03-05  8:47 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2005-03-04 12:37 UTC (permalink / raw)
  To: davem; +Cc: jgarzik, netdev, akpm, herbert


From: Herbert Poetzl <herbert@13thfloor.at>

x25_create() [net/x25/af_x25.c] is calling sock_init_data() twice ...  once
indirectly via x25_alloc_socket() and a second time directly via
sock_init_data(sock, sk);

while this might not look as critical as it seems, it can easily break
stuff which assumes that sock_init_data() isn't called twice on the same
socket.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 /dev/null                |    0 
 25-akpm/net/x25/af_x25.c |    1 -
 2 files changed, 1 deletion(-)

diff -puN net/x25/af_x25.c~x25_create-initializing-socket-data-twice net/x25/af_x25.c
--- 25/net/x25/af_x25.c~x25_create-initializing-socket-data-twice	2005-03-02 19:22:48.000000000 -0800
+++ 25-akpm/net/x25/af_x25.c	2005-03-02 19:22:48.000000000 -0800
@@ -490,7 +490,6 @@ static int x25_create(struct socket *soc
 
 	x25 = x25_sk(sk);
 
-	sock_init_data(sock, sk);
 	sk_set_owner(sk, THIS_MODULE);
 
 	x25_init_timers(sk);
diff -L net/x25/af_x25.c.orig -puN /dev/null /dev/null
_

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

* Re: [patch 3/3] x25_create initializing socket data twice
  2005-03-04 12:37 [patch 3/3] x25_create initializing socket data twice akpm
@ 2005-03-05  8:47 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2005-03-05  8:47 UTC (permalink / raw)
  To: akpm; +Cc: davem, jgarzik, netdev, akpm, herbert

akpm@osdl.org wrote:
> 
> x25_create() [net/x25/af_x25.c] is calling sock_init_data() twice ...  once
> indirectly via x25_alloc_socket() and a second time directly via
> sock_init_data(sock, sk);
> 
> while this might not look as critical as it seems, it can easily break
> stuff which assumes that sock_init_data() isn't called twice on the same
> socket.

As someone pointed out on LKML, this is broken since the sock_init_data
in x25_alloc_socket() is called with the first argument set to NULL.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2005-03-05  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-04 12:37 [patch 3/3] x25_create initializing socket data twice akpm
2005-03-05  8:47 ` Herbert Xu

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).