Re: BUG: sleeping function called from invalid context in lock_sock_nested (2)

From: Guenter Roeck
Date: Sat Feb 22 2020 - 10:21:47 EST

On 2/22/20 7:08 AM, syzbot wrote:

syzbot found the following crash on:

HEAD commit: 0a44cac8 Merge tag 'dma-mapping-5.6' of git://git.infradea..
git tree: upstream
console output:
kernel config:
dashboard link:
compiler: clang version 10.0.0 ( c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
syz repro:
C reproducer:

The bug was bisected to:

commit 5ac6badc5aa057ceb1d50c93326a81db6e89ad2f
Author: Daniel Mack <daniel@xxxxxxxxxx>
Date: Thu Jul 11 12:45:03 2019 +0000

device-tree: bindinds: add NXP PCT2075 as compatible device to LM75

Guess syzbot's bisect mechanism needs a bit of work.


bisection log:
final crash:
console output:

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+a5df189917e79d5e59c9@xxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: 5ac6badc5aa0 ("device-tree: bindinds: add NXP PCT2075 as compatible device to LM75")

BUG: sleeping function called from invalid context at net/core/sock.c:2935
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2687, name: kworker/1:3
INFO: lockdep is turned off.
Preemption disabled at:
[<ffffffff867b39c7>] sock_hash_free+0xd7/0x460 net/core/sock_map.c:869
CPU: 1 PID: 2687 Comm: kworker/1:3 Not tainted 5.6.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events bpf_map_free_deferred
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fb/0x318 lib/dump_stack.c:118
___might_sleep+0x449/0x5e0 kernel/sched/core.c:6798
__might_sleep+0x8f/0x100 kernel/sched/core.c:6751
lock_sock_nested+0x36/0x120 net/core/sock.c:2935
lock_sock include/net/sock.h:1516 [inline]
sock_hash_free+0x200/0x460 net/core/sock_map.c:872
bpf_map_free_deferred+0xb2/0x110 kernel/bpf/syscall.c:474
process_one_work+0x7f5/0x10f0 kernel/workqueue.c:2264
worker_thread+0xbbc/0x1630 kernel/workqueue.c:2410
kthread+0x332/0x350 kernel/kthread.c:255
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

This bug is generated by a bot. It may contain errors.
See for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxxx

syzbot will keep track of this bug report. See: for how to communicate with syzbot.
For information about bisection process see:
syzbot can test patches for this bug, for details see: