Skip to content

Commit

Permalink
[IPV6] RAW: Don't release unlocked sock.
Browse files Browse the repository at this point in the history
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 <nakam@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Masahide NAKAMURA authored and David S. Miller committed Dec 7, 2006
1 parent 9a217a1 commit 4e33fa1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
}
done:
dst_release(dst);
release_sock(sk);
if (!inet->hdrincl)
release_sock(sk);
out:
fl6_sock_release(flowlabel);
return err<0?err:len;
Expand Down

0 comments on commit 4e33fa1

Please sign in to comment.