netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: isotp: fix isotp_getname() leak
@ 2021-01-12  9:04 Oliver Hartkopp
  2021-01-12  9:12 ` Marc Kleine-Budde
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Hartkopp @ 2021-01-12  9:04 UTC (permalink / raw)
  To: mkl, kuba, netdev, linux-can
  Cc: Oliver Hartkopp, Cong Wang, syzbot+057884e2f453e8afebc8

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
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
 net/can/isotp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/can/isotp.c b/net/can/isotp.c
index 7839c3b9e5be..3ef7f78e553b 100644
--- a/net/can/isotp.c
+++ b/net/can/isotp.c
@@ -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;
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] can: isotp: fix isotp_getname() leak
  2021-01-12  9:04 [PATCH] can: isotp: fix isotp_getname() leak Oliver Hartkopp
@ 2021-01-12  9:12 ` Marc Kleine-Budde
  2021-01-12  9:17   ` Oliver Hartkopp
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Kleine-Budde @ 2021-01-12  9:12 UTC (permalink / raw)
  To: Oliver Hartkopp, kuba, netdev, linux-can
  Cc: Cong Wang, syzbot+057884e2f453e8afebc8


[-- Attachment #1.1: Type: text/plain, Size: 621 bytes --]

On 1/12/21 10:04 AM, Oliver Hartkopp wrote:
> 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
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

Can you add a Fixes: tag?

Marc

-- 
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 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] can: isotp: fix isotp_getname() leak
  2021-01-12  9:12 ` Marc Kleine-Budde
@ 2021-01-12  9:17   ` Oliver Hartkopp
  0 siblings, 0 replies; 3+ messages in thread
From: Oliver Hartkopp @ 2021-01-12  9:17 UTC (permalink / raw)
  To: Marc Kleine-Budde, kuba, netdev, linux-can
  Cc: Cong Wang, syzbot+057884e2f453e8afebc8



On 12.01.21 10:12, Marc Kleine-Budde wrote:
> On 1/12/21 10:04 AM, Oliver Hartkopp wrote:
>> 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
>> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
> 
> Can you add a Fixes: tag?

Yes, of course.

Sent out a v2 with Fixes: tag.

Best regards,
Oliver

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-12  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12  9:04 [PATCH] can: isotp: fix isotp_getname() leak Oliver Hartkopp
2021-01-12  9:12 ` Marc Kleine-Budde
2021-01-12  9:17   ` Oliver Hartkopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).