can: Fix raw_getname() leak
Subsystems (3)
PATCH 1/1 can: Fix raw_getname() leak
raw_getname() can leak 10 bytes of kernel memory to user
(two bytes hole between can_family and can_ifindex, 8 bytes at the end of sockaddr_can structure)
Signed-off-by Eric Dumazet <[email protected]>
---
net/can/raw.c +1 -0
@@ -401,6 +401,7 @@ static int raw_getname(struct socket *sock, struct sockaddr *uaddr,if (peer)return -EOPNOTSUPP ; +memset (addr,0 ,sizeof (*addr)); addr->can_family =AF_CAN ; addr->can_ifindex = ro->ifindex;
Quoted 6 lines · Eric Dumazet
raw_getname()can leak 10 bytes of kernel memory to user(two bytes hole between
can_familyandcan_ifindex, 8 bytes at the end ofsockaddr_canstructure)Signed-off-by Eric Dumazet <[email protected]>
Acked-by Oliver Hartkopp <[email protected]>
Thanks Eric!
Quoted 13 lines
---
net/can/raw.c +1
-0@@ -401,6 +401,7 @@ static int raw_getname(struct socket *sock, struct sockaddr *uaddr,if (peer)return -EOPNOTSUPP ; +memset (addr,0 ,sizeof (*addr)); addr->can_family =AF_CAN ; addr->can_ifindex = ro->ifindex;
From: Oliver Hartkopp <[email protected]>
Date: Fri, 07 Aug 2009 08:31:59 +0200
Quoted 9 lines
Quoted 6 lines · Eric Dumazet
raw_getname()can leak 10 bytes of kernel memory to user(two bytes hole between
can_familyandcan_ifindex, 8 bytes at the end ofsockaddr_canstructure)Signed-off-by Eric Dumazet <[email protected]>Acked-by Oliver Hartkopp <[email protected]>
Applied.