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 <eric.dumazet@gmail.com> Acked-by: Oliver Hartkopp <oliver@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
b79a79471b
commit
e84b90ae5e
@@ -401,6 +401,7 @@ static int raw_getname(struct socket *sock, struct sockaddr *uaddr,
|
|||||||
if (peer)
|
if (peer)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
memset(addr, 0, sizeof(*addr));
|
||||||
addr->can_family = AF_CAN;
|
addr->can_family = AF_CAN;
|
||||||
addr->can_ifindex = ro->ifindex;
|
addr->can_ifindex = ro->ifindex;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user