Skip to contentSkip to conversation

RAW: Don't release unlocked sock.

PATCH In review Masahide NAKAMURA 2 participants 2 messages Dec 5, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 net/ipv6/raw.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/ipv6/raw.c +2 -1
index d6dedc4..aa1d420 100644
@@ -855,7 +855,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;
Signature · 1 line
1.4.2
maintainer
#1 lore raw

From: Masahide NAKAMURA <[email protected]>
Date: Tue, 5 Dec 2006 19:03:14 +0900

Quoted 8 lines

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.

Patch applied, thank you very much.