mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices
@ 2026-01-09  1:36 Jerry Wu
  2026-01-09  7:50 ` Vincent Mailhol
  0 siblings, 1 reply; 3+ messages in thread
From: Jerry Wu @ 2026-01-09  1:36 UTC (permalink / raw)
  To: mkl; +Cc: mailhol, extja, eeodqql09, linux-can, linux-kernel, w.7erry

Uninitialized Kernel memory can leak to USB devices.

Fix this by using kzalloc() instead of kmalloc().

Fixes: 7259124eac7d ("can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.c")
Signed-off-by: Jerry Wu <w.7erry@foxmail.com>
---
Commit da2311a6385c (can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices) 
fixed a similar issue, CVE-2019-19947, in the same file. The other functions 
contain similar logic. Would it make sense to fix them in the same way?

Thank you for time reading this. My apologies if I missed anything.

 drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c
index 1167d38344f1..b031e6e42a41 100644
--- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c
+++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c
@@ -723,7 +723,7 @@ static int kvaser_usb_leaf_send_simple_cmd(const struct kvaser_usb *dev,
 	struct kvaser_cmd *cmd;
 	int rc;
 
-	cmd = kmalloc(sizeof(*cmd), GFP_KERNEL);
+	cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
 	if (!cmd)
 		return -ENOMEM;
 
@@ -1881,7 +1881,7 @@ static int kvaser_usb_leaf_set_bittiming(const struct net_device *netdev,
 	struct kvaser_cmd *cmd;
 	int rc;
 
-	cmd = kmalloc(sizeof(*cmd), GFP_KERNEL);
+	cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
 	if (!cmd)
 		return -ENOMEM;
 
-- 
2.52.0


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

end of thread, other threads:[~2026-01-09  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-09  1:36 [PATCH net] can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices Jerry Wu
2026-01-09  7:50 ` Vincent Mailhol
2026-01-09  8:18   ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®