syzbot


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

Status: upstream: reported on 2025/06/27 16:20
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+ea4c8fd177a47338881a@syzkaller.appspotmail.com
First crash: 6d13h, last: 6d13h
Discussions (3)
Title Replies (including bot) Last reply
[PATCH] brd: fix sleeping memory allocation in brd_insert_page() 1 (1) 2025/06/28 08:36
[PATCH] brd: fix leeping function called from invalid context in brd_insert_page() 3 (3) 2025/06/28 01:23
[syzbot] [block?] BUG: sleeping function called from invalid context in __xas_nomem (2) 0 (1) 2025/06/27 16:20
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: sleeping function called from invalid context in __xas_nomem btrfs 7 1067d 1083d 0/29 auto-obsoleted due to no activity on 2022/11/25 11:06

Sample crash report:
BUG: sleeping function called from invalid context at ./include/linux/sched/mm.h:321
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 6843, name: syz.1.211
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
1 lock held by syz.1.211/6843:
 #0: ffffffff8e5c47c0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_release include/linux/rcupdate.h:341 [inline]
 #0: ffffffff8e5c47c0 (rcu_read_lock){....}-{1:3}, at: rcu_read_unlock include/linux/rcupdate.h:871 [inline]
 #0: ffffffff8e5c47c0 (rcu_read_lock){....}-{1:3}, at: brd_insert_page drivers/block/brd.c:65 [inline]
 #0: ffffffff8e5c47c0 (rcu_read_lock){....}-{1:3}, at: brd_rw_bvec drivers/block/brd.c:121 [inline]
 #0: ffffffff8e5c47c0 (rcu_read_lock){....}-{1:3}, at: brd_submit_bio+0x935/0x10a0 drivers/block/brd.c:191
CPU: 1 UID: 0 PID: 6843 Comm: syz.1.211 Not tainted 6.16.0-rc3-syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x16c/0x1f0 lib/dump_stack.c:120
 __might_resched+0x3c0/0x5e0 kernel/sched/core.c:8800
 might_alloc include/linux/sched/mm.h:321 [inline]
 might_alloc include/linux/sched/mm.h:316 [inline]
 slab_pre_alloc_hook mm/slub.c:4099 [inline]
 slab_alloc_node mm/slub.c:4177 [inline]
 kmem_cache_alloc_lru_noprof+0x2d2/0x3b0 mm/slub.c:4216
 __xas_nomem+0x266/0x670 lib/xarray.c:341
 __xa_cmpxchg_raw lib/xarray.c:1786 [inline]
 __xa_cmpxchg+0x119/0x290 lib/xarray.c:1766
 brd_insert_page drivers/block/brd.c:72 [inline]
 brd_rw_bvec drivers/block/brd.c:121 [inline]
 brd_submit_bio+0x9ce/0x10a0 drivers/block/brd.c:191
 __submit_bio+0x301/0x690 block/blk-core.c:644
 __submit_bio_noacct block/blk-core.c:690 [inline]
 submit_bio_noacct_nocheck+0x852/0xd30 block/blk-core.c:753
 submit_bio_noacct+0x50d/0x1eb0 block/blk-core.c:874
 __blkdev_direct_IO block/fops.c:257 [inline]
 blkdev_direct_IO+0x1647/0x1ff0 block/fops.c:433
 blkdev_direct_write block/fops.c:701 [inline]
 blkdev_write_iter+0x6fd/0xdf0 block/fops.c:768
 do_iter_readv_writev+0x654/0x950 fs/read_write.c:827
 vfs_writev+0x35f/0xde0 fs/read_write.c:1057
 do_writev+0x132/0x340 fs/read_write.c:1103
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
 __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306
 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7f11579
Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f503655c EFLAGS: 00000296 ORIG_RAX: 0000000000000092
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000080000a40
RDX: 0000000000000021 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
----------------
Code disassembly (best guess), 2 bytes skipped:
   0:	10 06                	adc    %al,(%rsi)
   2:	03 74 b4 01          	add    0x1(%rsp,%rsi,4),%esi
   6:	10 07                	adc    %al,(%rdi)
   8:	03 74 b0 01          	add    0x1(%rax,%rsi,4),%esi
   c:	10 08                	adc    %cl,(%rax)
   e:	03 74 d8 01          	add    0x1(%rax,%rbx,8),%esi
  1e:	00 51 52             	add    %dl,0x52(%rcx)
  21:	55                   	push   %rbp
  22:	89 e5                	mov    %esp,%ebp
  24:	0f 34                	sysenter
  26:	cd 80                	int    $0x80
* 28:	5d                   	pop    %rbp <-- trapping instruction
  29:	5a                   	pop    %rdx
  2a:	59                   	pop    %rcx
  2b:	c3                   	ret
  2c:	90                   	nop
  2d:	90                   	nop
  2e:	90                   	nop
  2f:	90                   	nop
  30:	8d b4 26 00 00 00 00 	lea    0x0(%rsi,%riz,1),%esi
  37:	8d b4 26 00 00 00 00 	lea    0x0(%rsi,%riz,1),%esi

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/23 16:08 upstream 86731a2a651e d6cdfb8a .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 BUG: sleeping function called from invalid context in __xas_nomem
* Struck through repros no longer work on HEAD.