* [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_dev_up
@ 2024-01-25 14:59 syzbot
2024-01-25 16:23 ` syzbot
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: syzbot @ 2024-01-25 14:59 UTC (permalink / raw)
To: davem, edumazet, krzysztof.kozlowski, kuba, linux-kernel, netdev,
pabeni, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 9f8413c4a66f Merge tag 'cgroup-for-6.8' of git://git.kerne..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14d73c27e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=656820e61b758b15
dashboard link: https://syzkaller.appspot.com/bug?extid=7ea9413ea6749baf5574
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/79d9f2f4b065/disk-9f8413c4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/cbc68430d9c6/vmlinux-9f8413c4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9740ad9fc172/bzImage-9f8413c4.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+7ea9413ea6749baf5574@syzkaller.appspotmail.com
=====================================================
BUG: KMSAN: uninit-value in nci_init_req net/nfc/nci/core.c:177 [inline]
BUG: KMSAN: uninit-value in __nci_request net/nfc/nci/core.c:108 [inline]
BUG: KMSAN: uninit-value in nci_open_device net/nfc/nci/core.c:521 [inline]
BUG: KMSAN: uninit-value in nci_dev_up+0xfec/0x1b10 net/nfc/nci/core.c:632
nci_init_req net/nfc/nci/core.c:177 [inline]
__nci_request net/nfc/nci/core.c:108 [inline]
nci_open_device net/nfc/nci/core.c:521 [inline]
nci_dev_up+0xfec/0x1b10 net/nfc/nci/core.c:632
nfc_dev_up+0x26e/0x440 net/nfc/core.c:118
nfc_genl_dev_up+0xfe/0x1d0 net/nfc/netlink.c:770
genl_family_rcv_msg_doit net/netlink/genetlink.c:972 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:1052 [inline]
genl_rcv_msg+0x11ec/0x1290 net/netlink/genetlink.c:1067
netlink_rcv_skb+0x371/0x650 net/netlink/af_netlink.c:2545
genl_rcv+0x40/0x60 net/netlink/genetlink.c:1076
netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline]
netlink_unicast+0xf47/0x1250 net/netlink/af_netlink.c:1368
netlink_sendmsg+0x1238/0x13d0 net/netlink/af_netlink.c:1910
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638
__sys_sendmsg net/socket.c:2667 [inline]
__do_sys_sendmsg net/socket.c:2676 [inline]
__se_sys_sendmsg net/socket.c:2674 [inline]
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2674
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x6d/0x140 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Uninit was stored to memory at:
nci_core_reset_ntf_packet net/nfc/nci/ntf.c:36 [inline]
nci_ntf_packet+0x19dc/0x39c0 net/nfc/nci/ntf.c:782
nci_rx_work+0x213/0x500 net/nfc/nci/core.c:1522
process_one_work kernel/workqueue.c:2633 [inline]
process_scheduled_works+0x104e/0x1e70 kernel/workqueue.c:2706
worker_thread+0xf45/0x1490 kernel/workqueue.c:2787
kthread+0x3ed/0x540 kernel/kthread.c:388
ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Uninit was created at:
slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x5e9/0xb10 mm/slub.c:3523
kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:560
__alloc_skb+0x318/0x740 net/core/skbuff.c:651
alloc_skb include/linux/skbuff.h:1286 [inline]
virtual_ncidev_write+0x6d/0x280 drivers/nfc/virtual_ncidev.c:120
vfs_write+0x48b/0x1200 fs/read_write.c:588
ksys_write+0x20f/0x4c0 fs/read_write.c:643
__do_sys_write fs/read_write.c:655 [inline]
__se_sys_write fs/read_write.c:652 [inline]
__x64_sys_write+0x93/0xd0 fs/read_write.c:652
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x6d/0x140 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
CPU: 1 PID: 5642 Comm: syz-executor.0 Not tainted 6.7.0-syzkaller-00562-g9f8413c4a66f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
=====================================================
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_dev_up
2024-01-25 14:59 [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_dev_up syzbot
@ 2024-01-25 16:23 ` syzbot
2024-03-10 6:12 ` [syzbot] [PATCH net] nfc: nci: Fix " syzbot
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-01-25 16:23 UTC (permalink / raw)
To: davem, edumazet, krzysztof.kozlowski, kuba, linux-kernel, netdev,
pabeni, syzkaller-bugs
syzbot has found a reproducer for the following issue on:
HEAD commit: 9f8413c4a66f Merge tag 'cgroup-for-6.8' of git://git.kerne..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=12c59927e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=656820e61b758b15
dashboard link: https://syzkaller.appspot.com/bug?extid=7ea9413ea6749baf5574
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=153e178be80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10a6c1e3e80000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/79d9f2f4b065/disk-9f8413c4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/cbc68430d9c6/vmlinux-9f8413c4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9740ad9fc172/bzImage-9f8413c4.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+7ea9413ea6749baf5574@syzkaller.appspotmail.com
=====================================================
BUG: KMSAN: uninit-value in nci_init_req net/nfc/nci/core.c:177 [inline]
BUG: KMSAN: uninit-value in __nci_request net/nfc/nci/core.c:108 [inline]
BUG: KMSAN: uninit-value in nci_open_device net/nfc/nci/core.c:521 [inline]
BUG: KMSAN: uninit-value in nci_dev_up+0xfec/0x1b10 net/nfc/nci/core.c:632
nci_init_req net/nfc/nci/core.c:177 [inline]
__nci_request net/nfc/nci/core.c:108 [inline]
nci_open_device net/nfc/nci/core.c:521 [inline]
nci_dev_up+0xfec/0x1b10 net/nfc/nci/core.c:632
nfc_dev_up+0x26e/0x440 net/nfc/core.c:118
nfc_genl_dev_up+0xfe/0x1d0 net/nfc/netlink.c:770
genl_family_rcv_msg_doit net/netlink/genetlink.c:972 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:1052 [inline]
genl_rcv_msg+0x11ec/0x1290 net/netlink/genetlink.c:1067
netlink_rcv_skb+0x371/0x650 net/netlink/af_netlink.c:2545
genl_rcv+0x40/0x60 net/netlink/genetlink.c:1076
netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline]
netlink_unicast+0xf47/0x1250 net/netlink/af_netlink.c:1368
netlink_sendmsg+0x1238/0x13d0 net/netlink/af_netlink.c:1910
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638
__sys_sendmsg net/socket.c:2667 [inline]
__do_sys_sendmsg net/socket.c:2676 [inline]
__se_sys_sendmsg net/socket.c:2674 [inline]
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2674
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x6d/0x140 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Uninit was stored to memory at:
nci_core_reset_ntf_packet net/nfc/nci/ntf.c:36 [inline]
nci_ntf_packet+0x19dc/0x39c0 net/nfc/nci/ntf.c:782
nci_rx_work+0x213/0x500 net/nfc/nci/core.c:1522
process_one_work kernel/workqueue.c:2633 [inline]
process_scheduled_works+0x104e/0x1e70 kernel/workqueue.c:2706
worker_thread+0xf45/0x1490 kernel/workqueue.c:2787
kthread+0x3ed/0x540 kernel/kthread.c:388
ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Uninit was created at:
slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x5e9/0xb10 mm/slub.c:3523
kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:560
__alloc_skb+0x318/0x740 net/core/skbuff.c:651
alloc_skb include/linux/skbuff.h:1286 [inline]
virtual_ncidev_write+0x6d/0x280 drivers/nfc/virtual_ncidev.c:120
vfs_write+0x48b/0x1200 fs/read_write.c:588
ksys_write+0x20f/0x4c0 fs/read_write.c:643
__do_sys_write fs/read_write.c:655 [inline]
__se_sys_write fs/read_write.c:652 [inline]
__x64_sys_write+0x93/0xd0 fs/read_write.c:652
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x6d/0x140 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
CPU: 1 PID: 5012 Comm: syz-executor935 Not tainted 6.7.0-syzkaller-00562-g9f8413c4a66f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
=====================================================
---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [syzbot] [PATCH net] nfc: nci: Fix uninit-value in nci_dev_up
2024-01-25 14:59 [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_dev_up syzbot
2024-01-25 16:23 ` syzbot
@ 2024-03-10 6:12 ` syzbot
2024-03-12 13:41 ` [syzbot] [PATCH] " syzbot
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-03-10 6:12 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [PATCH net] nfc: nci: Fix uninit-value in nci_dev_up
Author: ryasuoka@redhat.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9f8413c4a66f2fb776d3dc3c9ed20bf435eb305e
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 994a0a1efb58..efdd733fc676 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -759,6 +759,9 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
{
__u16 ntf_opcode = nci_opcode(skb->data);
+ if (unlikely(!nci_plen(skb->data)))
+ goto end;
+
pr_debug("NCI RX: MT=ntf, PBF=%d, GID=0x%x, OID=0x%x, plen=%d\n",
nci_pbf(skb->data),
nci_opcode_gid(ntf_opcode),
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [syzbot] [PATCH] nfc: nci: Fix uninit-value in nci_dev_up
2024-01-25 14:59 [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_dev_up syzbot
2024-01-25 16:23 ` syzbot
2024-03-10 6:12 ` [syzbot] [PATCH net] nfc: nci: Fix " syzbot
@ 2024-03-12 13:41 ` syzbot
2024-03-12 14:31 ` [syzbot] [PATCH net] " syzbot
2024-03-18 15:56 ` [syzbot] [PATCH net v2] " syzbot
4 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-03-12 13:41 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [PATCH] nfc: nci: Fix uninit-value in nci_dev_up
Author: ryasuoka@redhat.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9f8413c4a66f2fb776d3dc3c9ed20bf435eb305e
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 994a0a1efb58..56624387e253 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -765,6 +765,9 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
nci_opcode_oid(ntf_opcode),
nci_plen(skb->data));
+ if (!nci_plen(skb->data))
+ goto end;
+
/* strip the nci control header */
skb_pull(skb, NCI_CTRL_HDR_SIZE);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [syzbot] [PATCH net] nfc: nci: Fix uninit-value in nci_dev_up
2024-01-25 14:59 [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_dev_up syzbot
` (2 preceding siblings ...)
2024-03-12 13:41 ` [syzbot] [PATCH] " syzbot
@ 2024-03-12 14:31 ` syzbot
2024-03-18 15:56 ` [syzbot] [PATCH net v2] " syzbot
4 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-03-12 14:31 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [PATCH net] nfc: nci: Fix uninit-value in nci_dev_up
Author: ryasuoka@redhat.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 994a0a1efb58..56624387e253 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -765,6 +765,9 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
nci_opcode_oid(ntf_opcode),
nci_plen(skb->data));
+ if (!nci_plen(skb->data))
+ goto end;
+
/* strip the nci control header */
skb_pull(skb, NCI_CTRL_HDR_SIZE);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [syzbot] [PATCH net v2] nfc: nci: Fix uninit-value in nci_dev_up
2024-01-25 14:59 [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_dev_up syzbot
` (3 preceding siblings ...)
2024-03-12 14:31 ` [syzbot] [PATCH net] " syzbot
@ 2024-03-18 15:56 ` syzbot
4 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-03-18 15:56 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [PATCH net v2] nfc: nci: Fix uninit-value in nci_dev_up
Author: ryasuoka@redhat.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9f8413c4a66f2fb776d3dc3c9ed20bf435eb305e
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 6c9592d05120..f471fc54c6a1 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -1512,6 +1512,11 @@ static void nci_rx_work(struct work_struct *work)
nfc_send_to_raw_sock(ndev->nfc_dev, skb,
RAW_PAYLOAD_NCI, NFC_DIRECTION_RX);
+ if (!nci_plen(skb->data)) {
+ kfree_skb(skb);
+ break;
+ }
+
/* Process frame */
switch (nci_mt(skb->data)) {
case NCI_MT_RSP_PKT:
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [syzbot] [PATCH net v2] nfc: nci: Fix uninit-value in nci_dev_up
2024-01-01 13:39 [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_ntf_packet syzbot
@ 2024-03-19 2:18 ` syzbot
0 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2024-03-19 2:18 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [PATCH net v2] nfc: nci: Fix uninit-value in nci_dev_up
Author: ryasuoka@redhat.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 610a9b8f49fbcf1100716370d3b5f6f884a2835a
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 6c9592d05120..f471fc54c6a1 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -1512,6 +1512,11 @@ static void nci_rx_work(struct work_struct *work)
nfc_send_to_raw_sock(ndev->nfc_dev, skb,
RAW_PAYLOAD_NCI, NFC_DIRECTION_RX);
+ if (!nci_plen(skb->data)) {
+ kfree_skb(skb);
+ break;
+ }
+
/* Process frame */
switch (nci_mt(skb->data)) {
case NCI_MT_RSP_PKT:
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-03-19 2:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 14:59 [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_dev_up syzbot
2024-01-25 16:23 ` syzbot
2024-03-10 6:12 ` [syzbot] [PATCH net] nfc: nci: Fix " syzbot
2024-03-12 13:41 ` [syzbot] [PATCH] " syzbot
2024-03-12 14:31 ` [syzbot] [PATCH net] " syzbot
2024-03-18 15:56 ` [syzbot] [PATCH net v2] " syzbot
-- strict thread matches above, loose matches on Subject: below --
2024-01-01 13:39 [syzbot] [net?] [nfc?] KMSAN: uninit-value in nci_ntf_packet syzbot
2024-03-19 2:18 ` [syzbot] [PATCH net v2] nfc: nci: Fix uninit-value in nci_dev_up syzbot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.