netdev
[Top] [All Lists]

Re: [PATCH] netlink: defer socket destruction a bit

To: Tommy Christensen <tommy.christensen@xxxxxxxxx>
Subject: Re: [PATCH] netlink: defer socket destruction a bit
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 May 2005 09:03:09 +1000
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxx, Ken-ichirou MATSUZAWA <chamas@xxxxxxxxxxxxx>
In-reply-to: <4282889A.7080409@tpack.net>
References: <428284D6.9000804@tpack.net> <20050511222421.GA21331@gondor.apana.org.au> <4282889A.7080409@tpack.net>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
On Thu, May 12, 2005 at 12:35:06AM +0200, Tommy Christensen wrote:
> 
> No, skb2 cannot be shared with a listening socket. As I read the code,
> it can only be non-null when delivery has failed.

What about this code path:

1) skb2 = skb, refcnt++.
2) Devliered to socket 1.
3) Socket 1 frees skb through recvmsg.
4) skb2 = skb, refcnt++.
5) Delivery fails.

Now skb2 is identical to skb and they both refer to socket 1.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<Prev in Thread] Current Thread [Next in Thread>