syzbot


upstream test error: BUG: sleeping function called from invalid context in sta_info_move_state

Status: fixed on 2021/03/10 01:48
Subsystems: wireless
[Documentation on labels]
Reported-by: syzbot+32c6c38c4812d22f2f0b@syzkaller.appspotmail.com
Fix commit: 7bc40aedf24d mac80211: free sta in sta_info_insert_finish() on errors
First crash: 1498d, last: 1485d
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 5.4 000/158] 5.4.80-rc1 review 166 (166) 2020/12/11 20:25
[PATCH 4.19 00/91] 4.19.160-rc1 review 98 (98) 2020/11/24 22:52
[PATCH 5.9 000/252] 5.9.11-rc1 review 259 (259) 2020/11/24 20:28
[PATCH 4.4 00/38] 4.4.246-rc1 review 43 (43) 2020/11/24 19:53
[PATCH 4.9 00/47] 4.9.246-rc1 review 51 (51) 2020/11/24 08:31
[PATCH 4.14 00/60] 4.14.209-rc1 review 63 (63) 2020/11/24 07:21
[PATCH] mac80211: free sta in sta_info_insert_finish() on errors 1 (1) 2020/11/12 10:22
upstream test error: BUG: sleeping function called from invalid context in sta_info_move_state 0 (1) 2020/11/10 22:45

Sample crash report:
BUG: sleeping function called from invalid context at net/mac80211/sta_info.c:1962
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 26, name: kworker/u4:2
4 locks held by kworker/u4:2/26:
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: process_one_work+0x821/0x15a0 kernel/workqueue.c:2243
 #1: ffffc90000e1fda8 ((work_completion)(&sdata->work)){+.+.}-{0:0}, at: process_one_work+0x854/0x15a0 kernel/workqueue.c:2247
 #2: ffff88801bd70d00 (&wdev->mtx){+.+.}-{3:3}, at: sdata_lock net/mac80211/ieee80211_i.h:1021 [inline]
 #2: ffff88801bd70d00 (&wdev->mtx){+.+.}-{3:3}, at: ieee80211_ibss_work+0x93/0xe80 net/mac80211/ibss.c:1683
 #3: ffffffff8b337820 (rcu_read_lock){....}-{1:2}, at: sta_info_insert_finish net/mac80211/sta_info.c:644 [inline]
 #3: ffffffff8b337820 (rcu_read_lock){....}-{1:2}, at: sta_info_insert_rcu+0x680/0x2ba0 net/mac80211/sta_info.c:732
Preemption disabled at:
[<ffffffff88e7501f>] __mutex_lock_common kernel/locking/mutex.c:955 [inline]
[<ffffffff88e7501f>] __mutex_lock+0x10f/0x10e0 kernel/locking/mutex.c:1103
CPU: 1 PID: 26 Comm: kworker/u4:2 Not tainted 5.10.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: phy3 ieee80211_iface_work
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:118
 ___might_sleep.cold+0x1e8/0x22e kernel/sched/core.c:7298
 sta_info_move_state+0x32/0x8d0 net/mac80211/sta_info.c:1962
 sta_info_free+0x65/0x3b0 net/mac80211/sta_info.c:274
 sta_info_insert_rcu+0x303/0x2ba0 net/mac80211/sta_info.c:738
 ieee80211_ibss_finish_sta+0x212/0x390 net/mac80211/ibss.c:592
 ieee80211_ibss_work+0x2c7/0xe80 net/mac80211/ibss.c:1700
 ieee80211_iface_work+0x82e/0x970 net/mac80211/iface.c:1476
 process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
 kthread+0x3af/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

=============================
[ BUG: Invalid wait context ]
5.10.0-rc4-syzkaller #0 Tainted: G        W        
-----------------------------
kworker/u4:2/26 is trying to lock:
ffff888018b229d0 (&local->chanctx_mtx){+.+.}-{3:3}, at: ieee80211_recalc_min_chandef+0x49/0x140 net/mac80211/util.c:2740
other info that might help us debug this:
context-{4:4}
4 locks held by kworker/u4:2/26:
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline]
 #0: ffff888030957938 ((wq_completion)phy3){+.+.}-{0:0}, at: process_one_work+0x821/0x15a0 kernel/workqueue.c:2243
 #1: ffffc90000e1fda8 ((work_completion)(&sdata->work)){+.+.}-{0:0}, at: process_one_work+0x854/0x15a0 kernel/workqueue.c:2247
 #2: ffff88801bd70d00 (&wdev->mtx){+.+.}-{3:3}, at: sdata_lock net/mac80211/ieee80211_i.h:1021 [inline]
 #2: ffff88801bd70d00 (&wdev->mtx){+.+.}-{3:3}, at: ieee80211_ibss_work+0x93/0xe80 net/mac80211/ibss.c:1683
 #3: ffffffff8b337820 (rcu_read_lock){....}-{1:2}, at: sta_info_insert_finish net/mac80211/sta_info.c:644 [inline]
 #3: ffffffff8b337820 (rcu_read_lock){....}-{1:2}, at: sta_info_insert_rcu+0x680/0x2ba0 net/mac80211/sta_info.c:732
stack backtrace:
CPU: 1 PID: 26 Comm: kworker/u4:2 Tainted: G        W         5.10.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: phy3 ieee80211_iface_work
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:118
 print_lock_invalid_wait_context kernel/locking/lockdep.c:4482 [inline]
 check_wait_context kernel/locking/lockdep.c:4543 [inline]
 __lock_acquire.cold+0x1d6/0x39f kernel/locking/lockdep.c:4780
 lock_acquire kernel/locking/lockdep.c:5435 [inline]
 lock_acquire+0x2a3/0x8c0 kernel/locking/lockdep.c:5400
 __mutex_lock_common kernel/locking/mutex.c:956 [inline]
 __mutex_lock+0x134/0x10e0 kernel/locking/mutex.c:1103
 ieee80211_recalc_min_chandef+0x49/0x140 net/mac80211/util.c:2740
 sta_info_move_state+0x3cf/0x8d0 net/mac80211/sta_info.c:2019
 sta_info_free+0x65/0x3b0 net/mac80211/sta_info.c:274
 sta_info_insert_rcu+0x303/0x2ba0 net/mac80211/sta_info.c:738
 ieee80211_ibss_finish_sta+0x212/0x390 net/mac80211/ibss.c:592
 ieee80211_ibss_work+0x2c7/0xe80 net/mac80211/ibss.c:1700
 ieee80211_iface_work+0x82e/0x970 net/mac80211/iface.c:1476
 process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
 kthread+0x3af/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

Crashes (53):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/11/18 20:46 upstream c2e7554e1b85 0767f13f .config console log report ci-upstream-kasan-gce-root
2020/11/18 08:43 upstream 0fa8ee0d9ab9 09323409 .config console log report ci-upstream-kasan-gce-root
2020/11/17 20:21 upstream 111e91a6df50 bd2a760b .config console log report ci-upstream-kasan-gce-smack-root
2020/11/17 01:09 upstream 9c87c9f41245 1bf9a662 .config console log report ci-upstream-kasan-gce
2020/11/16 23:37 upstream 9c87c9f41245 1bf9a662 .config console log report ci-qemu-upstream
2020/11/16 10:31 upstream 09162bc32c88 1bf9a662 .config console log report ci-upstream-kasan-gce-selinux-root
2020/11/16 10:01 upstream 09162bc32c88 1bf9a662 .config console log report ci-upstream-kasan-gce
2020/11/15 20:46 upstream 0062442ecfef 1bf9a662 .config console log report ci-upstream-kasan-gce
2020/11/14 21:27 upstream e28c0d7c92c8 1bf9a662 .config console log report ci-upstream-kasan-gce-root
2020/11/14 05:02 upstream f01c30de86f1 1bf9a662 .config console log report ci-upstream-kasan-gce-smack-root
2020/11/14 04:34 upstream f01c30de86f1 1bf9a662 .config console log report ci-upstream-kasan-gce
2020/11/13 14:26 upstream 585e5b17b92d 16fca0c8 .config console log report ci-upstream-kasan-gce-root
2020/11/13 10:54 upstream 585e5b17b92d 4a7fa9b4 .config console log report ci-qemu-upstream
2020/11/12 20:08 upstream af5043c89a8e 77a55c8e .config console log report ci-upstream-kasan-gce-smack-root
2020/11/12 19:48 upstream af5043c89a8e 77a55c8e .config console log report ci-upstream-kasan-gce-selinux-root
2020/11/12 19:37 upstream af5043c89a8e 77a55c8e .config console log report ci-qemu-upstream
2020/11/12 02:24 upstream 3d5e28bff7ad cca87986 .config console log report ci-upstream-kasan-gce
2020/11/12 02:15 upstream 3d5e28bff7ad cca87986 .config console log report ci-upstream-kasan-gce-selinux-root
2020/11/11 08:23 upstream eccc87672492 cca87986 .config console log report ci-upstream-kasan-gce-smack-root
2020/11/11 08:03 upstream eccc87672492 cca87986 .config console log report ci-upstream-kasan-gce-selinux-root
2020/11/10 20:41 upstream eccc87672492 cca87986 .config console log report ci-qemu-upstream
2020/11/10 18:44 upstream e2f0c565ec70 cca87986 .config console log report ci-upstream-kasan-gce-root
2020/11/10 18:36 upstream e2f0c565ec70 cca87986 .config console log report ci-upstream-kasan-gce-selinux-root
2020/11/09 12:40 upstream f8394f232b1e 64069d48 .config console log report ci-qemu-upstream
2020/11/09 11:36 upstream f8394f232b1e 64069d48 .config console log report ci-upstream-kasan-gce
2020/11/09 11:19 upstream f8394f232b1e 64069d48 .config console log report ci-upstream-kasan-gce-selinux-root
2020/11/08 23:07 upstream 15f5d201c177 64069d48 .config console log report ci-qemu-upstream
2020/11/08 02:28 upstream 4429f14aeea9 64069d48 .config console log report ci-upstream-kasan-gce-root
2020/11/08 02:11 upstream 4429f14aeea9 64069d48 .config console log report ci-upstream-kasan-gce
2020/11/07 12:55 upstream 659caaf65dc9 64069d48 .config console log report ci-upstream-kasan-gce
2020/11/07 12:47 upstream 659caaf65dc9 64069d48 .config console log report ci-upstream-kasan-gce-selinux-root
2020/11/07 12:38 upstream 659caaf65dc9 64069d48 .config console log report ci-upstream-kasan-gce-smack-root
2020/11/07 11:28 upstream 659caaf65dc9 64069d48 .config console log report ci-qemu-upstream
2020/11/07 11:28 upstream 659caaf65dc9 64069d48 .config console log report ci-qemu-upstream
2020/11/06 23:00 upstream bf3e76289cd2 64069d48 .config console log report ci-upstream-kasan-gce
2020/11/19 19:46 upstream 131ad0b6f529 0767f13f .config console log report ci-upstream-kasan-gce-386
2020/11/14 21:35 upstream e28c0d7c92c8 1bf9a662 .config console log report ci-qemu-upstream-386
2020/11/14 21:07 upstream e28c0d7c92c8 1bf9a662 .config console log report ci-upstream-kasan-gce-386
2020/11/14 12:55 upstream f01c30de86f1 1bf9a662 .config console log report ci-qemu-upstream-386
2020/11/14 12:55 upstream f01c30de86f1 1bf9a662 .config console log report ci-qemu-upstream-386
2020/11/12 19:32 upstream af5043c89a8e 77a55c8e .config console log report ci-upstream-kasan-gce-386
2020/11/12 02:53 upstream 3d5e28bff7ad cca87986 .config console log report ci-upstream-kasan-gce-386
2020/11/10 21:12 upstream eccc87672492 cca87986 .config console log report ci-qemu-upstream-386
2020/11/10 07:45 upstream 407ab579637c cca87986 .config console log report ci-qemu-upstream-386
2020/11/09 21:52 upstream 3552c3709c0e 64069d48 .config console log report ci-qemu-upstream-386
2020/11/06 22:42 upstream bf3e76289cd2 64069d48 .config console log report ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.