aboutsummaryrefslogtreecommitdiffstats
path: root/net/can/bcm.c
diff options
context:
space:
mode:
authorLothar Waßmann <LW@KARO-electronics.de>2009-07-14 19:10:21 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-15 14:20:37 -0400
commitf7e5cc0c40dff92bad2894153f675c6c542ba2f0 (patch)
treebd7e85854edeb3271f9a29f021392d7fdcc08bed /net/can/bcm.c
parent252aa9d94a04252046f3a382e6aca1b5c95921d8 (diff)
net/can bugfix: use after free bug in can protocol drivers
Fix a use after free bug in can protocol drivers The release functions of the can protocol drivers lack a call to sock_orphan() which leads to referencing freed memory under certain circumstances. This patch fixes a bug reported here: https://lists.berlios.de/pipermail/socketcan-users/2009-July/000985.html Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de> Acked-by: Oliver Hartkopp <oliver@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/can/bcm.c')
-rw-r--r--net/can/bcm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 95d7f32643ae..1d17e41b892d 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1469,6 +1469,9 @@ static int bcm_release(struct socket *sock)
1469 bo->ifindex = 0; 1469 bo->ifindex = 0;
1470 } 1470 }
1471 1471
1472 sock_orphan(sk);
1473 sock->sk = NULL;
1474
1472 release_sock(sk); 1475 release_sock(sk);
1473 sock_put(sk); 1476 sock_put(sk);
1474 1477