Skip to content

Commit

Permalink
can: isotp: isotp_getname(): fix kernel information leak
Browse files Browse the repository at this point in the history
Initialize the sockaddr_can structure to prevent a data leak to user space.

Suggested-by: Cong Wang <[email protected]>
Reported-by: [email protected]
Fixes: e057dd3 ("can: add ISO 15765-2:2016 transport protocol")
Signed-off-by: Oliver Hartkopp <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
hartkopp authored and marckleinebudde committed Jan 13, 2021
1 parent a95d25d commit b42b3a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/can/isotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ static int isotp_getname(struct socket *sock, struct sockaddr *uaddr, int peer)
if (peer)
return -EOPNOTSUPP;

memset(addr, 0, sizeof(*addr));
addr->can_family = AF_CAN;
addr->can_ifindex = so->ifindex;
addr->can_addr.tp.rx_id = so->rxid;
Expand Down

0 comments on commit b42b3a2

Please sign in to comment.