[syzbot] INFO: task hung in nfc_rfkill_set_block

15 views
Skip to first unread message

syzbot

unread,
Nov 15, 2022, 11:56:44 AM11/15/22
to bra...@kernel.org, bro...@kernel.org, catalin...@arm.com, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, madv...@linux.microsoft.com, sc...@os.amperecomputing.com, syzkall...@googlegroups.com, wi...@kernel.org
Hello,

syzbot found the following issue on:

HEAD commit: 9e4ce762f0e7 Merge branches 'for-next/acpi', 'for-next/asm..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=16248b85880000
kernel config: https://syzkaller.appspot.com/x/.config?x=20ffacc1ce1c99b5
dashboard link: https://syzkaller.appspot.com/bug?extid=3e3c2f8ca188e30b1427
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10b0df56880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=150b39a5880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a70eb29add74/disk-9e4ce762.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/769d096516a8/vmlinux-9e4ce762.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9309615f51d5/Image-9e4ce762.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3e3c2f...@syzkaller.appspotmail.com

INFO: task kworker/0:0:7 blocked for more than 143 seconds.
Not tainted 6.1.0-rc5-syzkaller-32254-g9e4ce762f0e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:0 state:D stack:0 pid:7 ppid:2 flags:0x00000008
Workqueue: events rfkill_sync_work
Call trace:
__switch_to+0x180/0x298 arch/arm64/kernel/process.c:553
context_switch kernel/sched/core.c:5191 [inline]
__schedule+0x408/0x594 kernel/sched/core.c:6503
schedule+0x64/0xa4 kernel/sched/core.c:6579
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6638
__mutex_lock_common+0x788/0xca8 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
device_lock include/linux/device.h:835 [inline]
nfc_dev_down net/nfc/core.c:143 [inline]
nfc_rfkill_set_block+0x3c/0x170 net/nfc/core.c:179
rfkill_set_block+0xb4/0x1f8 net/rfkill/core.c:345
rfkill_sync_work+0x64/0x80 net/rfkill/core.c:1042
process_one_work+0x2d8/0x504 kernel/workqueue.c:2289
worker_thread+0x340/0x610 kernel/workqueue.c:2436
kthread+0x12c/0x158 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:863
INFO: task kworker/0:16:4591 blocked for more than 143 seconds.
Not tainted 6.1.0-rc5-syzkaller-32254-g9e4ce762f0e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/0:16 state:D stack:0 pid:4591 ppid:2 flags:0x00000008
Workqueue: events rfkill_global_led_trigger_worker
Call trace:
__switch_to+0x180/0x298 arch/arm64/kernel/process.c:553
context_switch kernel/sched/core.c:5191 [inline]
__schedule+0x408/0x594 kernel/sched/core.c:6503
schedule+0x64/0xa4 kernel/sched/core.c:6579
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6638
__mutex_lock_common+0x788/0xca8 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
rfkill_global_led_trigger_worker+0x28/0xcc net/rfkill/core.c:181
process_one_work+0x2d8/0x504 kernel/workqueue.c:2289
worker_thread+0x340/0x610 kernel/workqueue.c:2436
kthread+0x12c/0x158 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:863
INFO: task syz-executor592:21127 blocked for more than 143 seconds.
Not tainted 6.1.0-rc5-syzkaller-32254-g9e4ce762f0e7 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor592 state:D stack:0 pid:21127 ppid:3132 flags:0x0000000c
Call trace:
__switch_to+0x180/0x298 arch/arm64/kernel/process.c:553
context_switch kernel/sched/core.c:5191 [inline]
__schedule+0x408/0x594 kernel/sched/core.c:6503
schedule+0x64/0xa4 kernel/sched/core.c:6579
schedule_timeout+0x64/0x1b4 kernel/time/timer.c:1911
do_wait_for_common+0xf4/0x184 kernel/sched/completion.c:85
__wait_for_common kernel/sched/completion.c:106 [inline]
wait_for_common kernel/sched/completion.c:117 [inline]
wait_for_completion+0x48/0x60 kernel/sched/completion.c:138
__flush_work+0xd4/0x144 kernel/workqueue.c:3073
__cancel_work_timer+0x1c4/0x2ac kernel/workqueue.c:3160
cancel_work_sync+0x24/0x38 kernel/workqueue.c:3196
rfkill_unregister+0x4c/0xec net/rfkill/core.c:1124
nfc_unregister_device+0x84/0x190 net/nfc/core.c:1167
nci_unregister_device+0xc4/0x100 net/nfc/nci/core.c:1302
virtual_ncidev_close+0x70/0xb0 drivers/nfc/virtual_ncidev.c:166
__fput+0x198/0x3e4 fs/file_table.c:320
____fput+0x20/0x30 fs/file_table.c:348
task_work_run+0x100/0x148 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x2dc/0xcac kernel/exit.c:820
__arm64_sys_exit_group+0x0/0x18 kernel/exit.c:950
__do_sys_exit_group kernel/exit.c:961 [inline]
__se_sys_exit_group kernel/exit.c:959 [inline]
__wake_up_parent+0x0/0x40 kernel/exit.c:959
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall arch/arm64/kernel/syscall.c:52 [inline]
el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584

Showing all locks held in the system:
4 locks held by kworker/0:0/7:
#0: ffff0000c0010738 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x270/0x504 kernel/workqueue.c:2262
#1: ffff80000f2c3d80 ((work_completion)(&rfkill->sync_work)){+.+.}-{0:0}, at: process_one_work+0x29c/0x504 kernel/workqueue.c:2264
#2: ffff80000d956080 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_sync_work+0x34/0x80 net/rfkill/core.c:1040
#3: ffff0000caf73900 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:835 [inline]
#3: ffff0000caf73900 (&dev->mutex){....}-{3:3}, at: nfc_dev_down net/nfc/core.c:143 [inline]
#3: ffff0000caf73900 (&dev->mutex){....}-{3:3}, at: nfc_rfkill_set_block+0x3c/0x170 net/nfc/core.c:179
1 lock held by rcu_tasks_kthre/11:
#0: ffff80000d4d4768 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x3c/0x450 kernel/rcu/tasks.h:507
1 lock held by rcu_tasks_trace/12:
#0: ffff80000d4d4db8 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x3c/0x450 kernel/rcu/tasks.h:507
1 lock held by khungtaskd/27:
#0: ffff80000d4d4640 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x4/0x48 include/linux/rcupdate.h:303
2 locks held by getty/2760:
#0: ffff0000c7b92098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x28/0x58 drivers/tty/tty_ldisc.c:244
#1: ffff80000f6ee2f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x19c/0x89c drivers/tty/n_tty.c:2177
3 locks held by kworker/0:16/4591:
#0: ffff0000c0010738 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x270/0x504 kernel/workqueue.c:2262
#1: ffff800013f4bd80 ((work_completion)(&rfkill_global_led_trigger_work)){+.+.}-{0:0}, at: process_one_work+0x29c/0x504 kernel/workqueue.c:2264
#2: ffff80000d956080 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_global_led_trigger_worker+0x28/0xcc net/rfkill/core.c:181
1 lock held by syz-executor592/21127:
#0: ffff0000caf73900 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:835 [inline]
#0: ffff0000caf73900 (&dev->mutex){....}-{3:3}, at: nfc_unregister_device+0x70/0x190 net/nfc/core.c:1165

=============================================



---
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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Hillf Danton

unread,
Nov 16, 2022, 12:03:34 AM11/16/22
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 15 Nov 2022 08:56:43 -0800
> syzbot found the following issue on:
>
> HEAD commit: 9e4ce762f0e7 Merge branches 'for-next/acpi', 'for-next/asm..
> git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
> console output: https://syzkaller.appspot.com/x/log.txt?x=16248b85880000
> kernel config: https://syzkaller.appspot.com/x/.config?x=20ffacc1ce1c99b5
> dashboard link: https://syzkaller.appspot.com/bug?extid=3e3c2f8ca188e30b1427
Destroy rfkill without device lock held.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git 9e4ce762f0e7

--- x/net/nfc/core.c
+++ a/net/nfc/core.c
@@ -1163,13 +1163,16 @@ void nfc_unregister_device(struct nfc_de
"was removed\n", dev_name(&dev->dev));

device_lock(&dev->dev);
+ dev->shutting_down = true;
if (dev->rfkill) {
- rfkill_unregister(dev->rfkill);
- rfkill_destroy(dev->rfkill);
+ struct rfkill *rfkill = dev->rfkill;
dev->rfkill = NULL;
- }
- dev->shutting_down = true;
- device_unlock(&dev->dev);
+
+ device_unlock(&dev->dev);
+ rfkill_unregister(rfkill);
+ rfkill_destroy(rfkill);
+ } else
+ device_unlock(&dev->dev);

if (dev->ops->check_presence) {
del_timer_sync(&dev->check_pres_timer);
--

syzbot

unread,
Nov 16, 2022, 1:22:16 AM11/16/22
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+3e3c2f...@syzkaller.appspotmail.com

Tested on:

commit: 9e4ce762 Merge branches 'for-next/acpi', 'for-next/asm..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=17f00a95880000
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=13d75735880000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
May 24, 2023, 1:43:27 AM5/24/23
to bra...@kernel.org, bro...@kernel.org, catalin...@arm.com, da...@davemloft.net, edum...@google.com, faenk...@gmail.com, hda...@sina.com, krzysztof...@linaro.org, ku...@kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, linu...@lists.01.org, luiz.vo...@intel.com, madv...@linux.microsoft.com, net...@vger.kernel.org, pab...@redhat.com, sc...@os.amperecomputing.com, syzkall...@googlegroups.com, wi...@kernel.org
syzbot has bisected this issue to:

commit 7ac7267fad5908476b357e7e9813d23516c2b0a1
Author: Fae <faenk...@gmail.com>
Date: Sun Jul 24 18:25:02 2022 +0000

Bluetooth: Add VID/PID 0489/e0e0 for MediaTek MT7921

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1523596a280000
start commit: ae8373a5add4 Merge tag 'x86_urgent_for_6.4-rc4' of git://g..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=1723596a280000
console output: https://syzkaller.appspot.com/x/log.txt?x=1323596a280000
kernel config: https://syzkaller.appspot.com/x/.config?x=927d4df6d674370e
dashboard link: https://syzkaller.appspot.com/bug?extid=3e3c2f8ca188e30b1427
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1099e2c5280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=113f66b1280000

Reported-by: syzbot+3e3c2f...@syzkaller.appspotmail.com
Fixes: 7ac7267fad59 ("Bluetooth: Add VID/PID 0489/e0e0 for MediaTek MT7921")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Nov 21, 2023, 5:55:05 AM11/21/23
to bra...@kernel.org, bro...@kernel.org, catalin...@arm.com, da...@davemloft.net, edum...@google.com, faenk...@gmail.com, hda...@sina.com, johann...@intel.com, joha...@sipsolutions.net, krzysztof...@linaro.org, ku...@kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, linu...@lists.01.org, linux-w...@vger.kernel.org, luiz.vo...@intel.com, madv...@linux.microsoft.com, net...@vger.kernel.org, pab...@redhat.com, sc...@os.amperecomputing.com, syzkall...@googlegroups.com, wi...@kernel.org
syzbot suspects this issue was fixed by commit:

commit 2c3dfba4cf84ac4f306cc6653b37b6dd6859ae9d
Author: Johannes Berg <johann...@intel.com>
Date: Thu Sep 14 13:45:17 2023 +0000

rfkill: sync before userspace visibility/changes

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=10d68677680000
start commit: ae8373a5add4 Merge tag 'x86_urgent_for_6.4-rc4' of git://g..
git tree: upstream
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: rfkill: sync before userspace visibility/changes
Reply all
Reply to author
Forward
0 new messages