Re: [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_ntf_packet (3)

From: Qianqiang Liu
Date: Sat Oct 12 2024 - 10:17:41 EST


#syz test

diff --git a/drivers/nfc/virtual_ncidev.c b/drivers/nfc/virtual_ncidev.c
index 6b89d596ba9a..31da26287327 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;

--
Best,
Qianqiang Liu