projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c43c5f3
)
packet: fix possible dev refcnt leak when bind fail
author
Wei Yongjun
<yongjun_wei@trendmicro.com.cn>
Wed, 28 Dec 2011 03:32:41 +0000
(22:32 -0500)
committer
David S. Miller
<davem@davemloft.net>
Wed, 28 Dec 2011 03:32:41 +0000
(22:32 -0500)
If bind is fail when bind is called after set PACKET_FANOUT
sock option, the dev refcnt will leak.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c
patch
|
blob
|
blame
|
history
diff --git
a/net/packet/af_packet.c
b/net/packet/af_packet.c
index 3891702b81df8fef757677dc779f4bddd2e31789..d9d4970b9b07c0da22f97e29a8ac0f38ec4caff1 100644
(file)
--- a/
net/packet/af_packet.c
+++ b/
net/packet/af_packet.c
@@
-2448,8
+2448,12
@@
static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 protoc
{
struct packet_sock *po = pkt_sk(sk);
- if (po->fanout)
+ if (po->fanout) {
+ if (dev)
+ dev_put(dev);
+
return -EINVAL;
+ }
lock_sock(sk);