can: isotp: fix isotp_getname() leak
Subsystems (4)
Oliver Hartkopp
maintainerPATCH 1/1 can: isotp: fix isotp_getname() leak
Initialize the sockaddr_can structure to prevent a data leak to user space.
Suggested-by Cong Wang <[email protected]>
Reported-by [email protected]
Signed-off-by Oliver Hartkopp <[email protected]>
--- net/can/isotp.c | 1 + 1 file changed, 1 insertion(+)
net/can/isotp.c +1 -0
@@ -1153,10 +1153,11 @@ static int isotp_getname(struct socket *sock, struct sockaddr *uaddr, int peer)struct isotp_sock *so =isotp_sk (sk);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; addr->can_addr.tp.tx_id = so->txid;
Signature · 1 line
2.29.2
Marc Kleine-Budde
maintainerQuoted 5 lines · Oliver Hartkopp
Initialize the
sockaddr_canstructure to prevent a data leak to user space.Suggested-by Cong Wang <[email protected]>Reported-by [email protected]Signed-off-by Oliver Hartkopp <[email protected]>
Can you add a Fixes: tag?
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Oliver Hartkopp
maintainerQuoted 8 lines · Marc Kleine-Budde
Quoted 5 lines · Oliver Hartkopp
Initialize the
sockaddr_canstructure to prevent a data leak to user space.Suggested-by Cong Wang <[email protected]>Reported-by [email protected]Signed-off-by Oliver Hartkopp <[email protected]>Can you add a Fixes: tag?
Yes, of course.
Sent out a v2 with Fixes: tag.
Best regards,
Oliver