From: Masahide NAKAMURA Date: Tue, 5 Dec 2006 21:48:27 +0000 (-0800) Subject: [IPV6] RAW: Don't release unlocked sock. X-Git-Tag: v2.6.20-rc1~145^2^2~7^2~19 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4e33fa14faecc150e97c0e4f2320745bdc7b7112;p=linux-2.6-omap-h63xx.git [IPV6] RAW: Don't release unlocked sock. When user builds IPv6 header and send it through raw socket, kernel tries to release unlocked sock. (Kernel log shows "BUG: bad unlock balance detected" with enabled debug option.) The lock is held only for non-hdrincl sock in this function then this patch fix to do nothing about lock for hdrincl one. Signed-off-by: Masahide NAKAMURA Signed-off-by: David S. Miller --- diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index c2e629d6aea..4ae1b19ada5 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -854,7 +854,8 @@ back_from_confirm: } done: dst_release(dst); - release_sock(sk); + if (!inet->hdrincl) + release_sock(sk); out: fl6_sock_release(flowlabel); return err<0?err:len;