summaryrefslogtreecommitdiffstats
path: root/net/can
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2021-01-12 10:16:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-17 14:17:05 +0100
commit61e8c02ae6d671e98ab2d82fa26815c480740961 (patch)
treefd455ca741edab7c18156858a7eff1fafeb0ccd2 /net/can
parent6f7a362e1c6fdc6fd9c0bea4c9b6f34b6d063a3f (diff)
downloadlinux-stable-61e8c02ae6d671e98ab2d82fa26815c480740961.tar.gz
linux-stable-61e8c02ae6d671e98ab2d82fa26815c480740961.tar.bz2
linux-stable-61e8c02ae6d671e98ab2d82fa26815c480740961.zip
can: isotp: isotp_getname(): fix kernel information leak
commit b42b3a2744b3e8f427de79896720c72823af91ad upstream. Initialize the sockaddr_can structure to prevent a data leak to user space. Suggested-by: Cong Wang <xiyou.wangcong@gmail.com> Reported-by: syzbot+057884e2f453e8afebc8@syzkaller.appspotmail.com Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/r/20210112091643.11789-1-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/can')
-rw-r--r--net/can/isotp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/can/isotp.c b/net/can/isotp.c
index 26bdc3c20b7e..8bd565f2073e 100644
--- a/net/can/isotp.c
+++ b/net/can/isotp.c
@@ -1139,6 +1139,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;