netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfc: nci: Fix uninit-value in nci_rx_work()
@ 2024-08-03 12:18 zhanghao
  2024-08-04 10:57 ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: zhanghao @ 2024-08-03 12:18 UTC (permalink / raw)
  To: bongsu.jeon, krzk
  Cc: syzbot+3da70a0abd7f5765b6ea, linux-kernel, netdev, zhanghao

Commit e624e6c3e777 ("nfc: Add a virtual nci device driver")
calls alloc_skb() with GFP_KERNEL as the argument flags.The
allocated heap memory was not initialized.This causes KMSAN
to detect an uninitialized value.

Reported-by: syzbot+3da70a0abd7f5765b6ea@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=3da70a0abd7f5765b6ea
Fixes: e624e6c3e777 ("nfc: Add a virtual nci device driver")
Link: https://lore.kernel.org/all/000000000000747dd6061a974686@google.com/T/
Signed-off-by: zhanghao <zhanghao1@kylinos.cn>
---
 drivers/nfc/virtual_ncidev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/virtual_ncidev.c b/drivers/nfc/virtual_ncidev.c
index 6b89d596ba9a..ae1592db131e 100644
--- a/drivers/nfc/virtual_ncidev.c
+++ b/drivers/nfc/virtual_ncidev.c
@@ -117,7 +117,7 @@ static ssize_t virtual_ncidev_write(struct file *file,
 	struct virtual_nci_dev *vdev = file->private_data;
 	struct sk_buff *skb;
 
-	skb = alloc_skb(count, GFP_KERNEL);
+	skb = alloc_skb(count, GFP_KERNEL|__GFP_ZERO);
 	if (!skb)
 		return -ENOMEM;
 

base-commit: 17712b7ea0756799635ba159cc773082230ed028
-- 
2.39.2


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

end of thread, other threads:[~2024-08-08  1:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-03 12:18 [PATCH] nfc: nci: Fix uninit-value in nci_rx_work() zhanghao
2024-08-04 10:57 ` Simon Horman
2024-08-05  8:20   ` Krzysztof Kozlowski
2024-08-08  0:59   ` zhanghao

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