lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <6800a344.050a0220.5cdb3.000d.GAE@google.com>
Date: Wed, 16 Apr 2025 23:44:20 -0700
From: syzbot <syzbot+764108b2012ab7b1aad2@...kaller.appspotmail.com>
To: dhowells@...hat.com, linux-afs@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, marc.dionne@...istor.com, 
	syzkaller-bugs@...glegroups.com
Subject: [syzbot] [afs?] BUG: sleeping function called from invalid context in __xfs_write_fault

Hello,

syzbot found the following issue on:

HEAD commit:    7cdabafc0012 Merge tag 'trace-v6.15-rc1' of git://git.kern..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=103bd398580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=fb8650d88e9fb80f
dashboard link: https://syzkaller.appspot.com/bug?extid=764108b2012ab7b1aad2
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/0f9317cc7b92/disk-7cdabafc.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b9e0f7e75505/vmlinux-7cdabafc.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5c11cc51cada/bzImage-7cdabafc.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+764108b2012ab7b1aad2@...kaller.appspotmail.com

BUG: sleeping function called from invalid context at ./include/linux/percpu-rwsem.h:50
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 6258, name: syz.2.54
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
4 locks held by syz.2.54/6258:
 #0: ffff88807c041b38 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x247/0x310 fs/file.c:1213
 #1: ffff88804d208148 (&type->i_mutex_dir_key#18){++++}-{4:4}, at: iterate_dir+0x4a6/0x760 fs/readdir.c:101
 #2: ffffffff8ed3dfa0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #2: ffffffff8ed3dfa0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #2: ffffffff8ed3dfa0 (rcu_read_lock){....}-{1:3}, at: afs_dynroot_readdir+0x466/0xbe0 fs/afs/dynroot.c:351
 #3: ffff88803143dbe0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_trylock include/linux/mmap_lock.h:203 [inline]
 #3: ffff88803143dbe0 (&mm->mmap_lock){++++}-{4:4}, at: get_mmap_lock_carefully mm/memory.c:6346 [inline]
 #3: ffff88803143dbe0 (&mm->mmap_lock){++++}-{4:4}, at: lock_mm_and_find_vma+0x32/0x2f0 mm/memory.c:6406
CPU: 1 UID: 0 PID: 6258 Comm: syz.2.54 Not tainted 6.15.0-rc1-syzkaller-00325-g7cdabafc0012 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 __might_resched+0x558/0x6c0 kernel/sched/core.c:8818
 percpu_down_read include/linux/percpu-rwsem.h:50 [inline]
 __sb_start_write include/linux/fs.h:1783 [inline]
 sb_start_pagefault include/linux/fs.h:1948 [inline]
 __xfs_write_fault+0x1cd/0x8f0 fs/xfs/xfs_file.c:1718
 xfs_write_fault+0x1a1/0x640 fs/xfs/xfs_file.c:1777
 do_page_mkwrite+0x159/0x340 mm/memory.c:3287
 wp_page_shared mm/memory.c:3688 [inline]
 do_wp_page+0x2bbc/0x5e00 mm/memory.c:3907
 handle_pte_fault+0xfaf/0x61c0 mm/memory.c:6013
 __handle_mm_fault mm/memory.c:6140 [inline]
 handle_mm_fault+0x1030/0x1aa0 mm/memory.c:6309
 do_user_addr_fault arch/x86/mm/fault.c:1388 [inline]
 handle_page_fault arch/x86/mm/fault.c:1480 [inline]
 exc_page_fault+0x2bb/0x920 arch/x86/mm/fault.c:1538
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:filldir+0x2c4/0x6a0 fs/readdir.c:292
Code: 87 55 02 00 00 0f 01 cb 0f ae e8 48 8b 44 24 30 49 89 46 08 48 8b 4c 24 10 48 8b 44 24 60 48 89 01 48 8b 44 24 18 8b 6c 24 3c <66> 89 41 10 48 98 40 88 6c 01 ff 48 89 44 24 30 4d 63 f5 42 c6 44
RSP: 0018:ffffc90003d8fbe0 EFLAGS: 00050283
RAX: 0000000000000018 RBX: 0000200000002008 RCX: 0000200000001ff0
RDX: 0000000000000000 RSI: 0000200000001fd8 RDI: 0000200000002008
RBP: 0000000000000004 R08: ffffffff82429e7d R09: 1ffff11005dcf780
R10: dffffc0000000000 R11: ffffed1005dcf781 R12: ffff8881432bfb41
R13: 0000000000000003 R14: 0000200000001fd8 R15: 00007ffffffff000
 dir_emit include/linux/fs.h:3861 [inline]
 afs_dynroot_readdir_cells fs/afs/dynroot.c:310 [inline]
 afs_dynroot_readdir+0x814/0xbe0 fs/afs/dynroot.c:352
 iterate_dir+0x5a9/0x760 fs/readdir.c:108
 __do_sys_getdents fs/readdir.c:322 [inline]
 __se_sys_getdents+0x1ff/0x4e0 fs/readdir.c:308
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f74f7f8d169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f74f8d45038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e
RAX: ffffffffffffffda RBX: 00007f74f81a6080 RCX: 00007f74f7f8d169
RDX: 00000000000000b8 RSI: 0000200000001fc0 RDI: 000000000000000e
RBP: 00007f74f800e990 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f74f81a6080 R15: 00007fff9d606378
 </TASK>

=============================
[ BUG: Invalid wait context ]
6.15.0-rc1-syzkaller-00325-g7cdabafc0012 #0 Tainted: G        W          
-----------------------------
syz.2.54/6258 is trying to lock:
ffff88807b5f2f98 (&xfs_nondir_ilock_class
){++++}-{4:4}, at: xfs_fs_dirty_inode+0x19d/0x260 fs/xfs/xfs_super.c:714
other info that might help us debug this:
context-{5:5}
6 locks held by syz.2.54/6258:
 #0: ffff88807c041b38 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x247/0x310 fs/file.c:1213
 #1: ffff88804d208148 (&type->i_mutex_dir_key#18){++++}-{4:4}, at: iterate_dir+0x4a6/0x760 fs/readdir.c:101
 #2: ffffffff8ed3dfa0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline]
 #2: ffffffff8ed3dfa0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline]
 #2: ffffffff8ed3dfa0 (rcu_read_lock){....}-{1:3}, at: afs_dynroot_readdir+0x466/0xbe0 fs/afs/dynroot.c:351
 #3: ffff88803143dbe0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_trylock include/linux/mmap_lock.h:203 [inline]
 #3: ffff88803143dbe0 (&mm->mmap_lock){++++}-{4:4}, at: get_mmap_lock_carefully mm/memory.c:6346 [inline]
 #3: ffff88803143dbe0 (&mm->mmap_lock){++++}-{4:4}, at: lock_mm_and_find_vma+0x32/0x2f0 mm/memory.c:6406
 #4: ffff88807f006518 (sb_pagefaults#2){.+.+}-{0:0}, at: xfs_write_fault+0x1a1/0x640 fs/xfs/xfs_file.c:1777
 #5: ffff88807f006610 (sb_internal#2){.+.+}-{0:0}, at: xfs_fs_dirty_inode+0x15a/0x260 fs/xfs/xfs_super.c:712
stack backtrace:
CPU: 1 UID: 0 PID: 6258 Comm: syz.2.54 Tainted: G        W           6.15.0-rc1-syzkaller-00325-g7cdabafc0012 #0 PREEMPT(full) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_lock_invalid_wait_context kernel/locking/lockdep.c:4831 [inline]
 check_wait_context kernel/locking/lockdep.c:4903 [inline]
 __lock_acquire+0xc30/0xd80 kernel/locking/lockdep.c:5185
 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866
 down_write_nested+0xa2/0x220 kernel/locking/rwsem.c:1693
 xfs_fs_dirty_inode+0x19d/0x260 fs/xfs/xfs_super.c:714
 __mark_inode_dirty+0x2ee/0xe90 fs/fs-writeback.c:2527
 generic_update_time+0xad/0xc0 fs/inode.c:2064
 xfs_vn_update_time+0x2a7/0x600 fs/xfs/xfs_iops.c:1136
 inode_update_time fs/inode.c:2076 [inline]
 __file_update_time fs/inode.c:2305 [inline]
 file_update_time+0x314/0x450 fs/inode.c:2335
 __xfs_write_fault+0x2ff/0x8f0 fs/xfs/xfs_file.c:1719
 xfs_write_fault+0x1a1/0x640 fs/xfs/xfs_file.c:1777
 do_page_mkwrite+0x159/0x340 mm/memory.c:3287
 wp_page_shared mm/memory.c:3688 [inline]
 do_wp_page+0x2bbc/0x5e00 mm/memory.c:3907
 handle_pte_fault+0xfaf/0x61c0 mm/memory.c:6013
 __handle_mm_fault mm/memory.c:6140 [inline]
 handle_mm_fault+0x1030/0x1aa0 mm/memory.c:6309
 do_user_addr_fault arch/x86/mm/fault.c:1388 [inline]
 handle_page_fault arch/x86/mm/fault.c:1480 [inline]
 exc_page_fault+0x2bb/0x920 arch/x86/mm/fault.c:1538
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:filldir+0x2c4/0x6a0 fs/readdir.c:292
Code: 87 55 02 00 00 0f 01 cb 0f ae e8 48 8b 44 24 30 49 89 46 08 48 8b 4c 24 10 48 8b 44 24 60 48 89 01 48 8b 44 24 18 8b 6c 24 3c <66> 89 41 10 48 98 40 88 6c 01 ff 48 89 44 24 30 4d 63 f5 42 c6 44
RSP: 0018:ffffc90003d8fbe0 EFLAGS: 00050283
RAX: 0000000000000018 RBX: 0000200000002008 RCX: 0000200000001ff0
RDX: 0000000000000000 RSI: 0000200000001fd8 RDI: 0000200000002008
RBP: 0000000000000004 R08: ffffffff82429e7d R09: 1ffff11005dcf780
R10: dffffc0000000000 R11: ffffed1005dcf781 R12: ffff8881432bfb41
R13: 0000000000000003 R14: 0000200000001fd8 R15: 00007ffffffff000
 dir_emit include/linux/fs.h:3861 [inline]
 afs_dynroot_readdir_cells fs/afs/dynroot.c:310 [inline]
 afs_dynroot_readdir+0x814/0xbe0 fs/afs/dynroot.c:352
 iterate_dir+0x5a9/0x760 fs/readdir.c:108
 __do_sys_getdents fs/readdir.c:322 [inline]
 __se_sys_getdents+0x1ff/0x4e0 fs/readdir.c:308
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f74f7f8d169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f74f8d45038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e
RAX: ffffffffffffffda RBX: 00007f74f81a6080 RCX: 00007f74f7f8d169
RDX: 00000000000000b8 RSI: 0000200000001fc0 RDI: 000000000000000e
RBP: 00007f74f800e990 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f74f81a6080 R15: 00007fff9d606378
 </TASK>
----------------
Code disassembly (best guess):
   0:	87 55 02             	xchg   %edx,0x2(%rbp)
   3:	00 00                	add    %al,(%rax)
   5:	0f 01 cb             	stac
   8:	0f ae e8             	lfence
   b:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
  10:	49 89 46 08          	mov    %rax,0x8(%r14)
  14:	48 8b 4c 24 10       	mov    0x10(%rsp),%rcx
  19:	48 8b 44 24 60       	mov    0x60(%rsp),%rax
  1e:	48 89 01             	mov    %rax,(%rcx)
  21:	48 8b 44 24 18       	mov    0x18(%rsp),%rax
  26:	8b 6c 24 3c          	mov    0x3c(%rsp),%ebp
* 2a:	66 89 41 10          	mov    %ax,0x10(%rcx) <-- trapping instruction
  2e:	48 98                	cltq
  30:	40 88 6c 01 ff       	mov    %bpl,-0x1(%rcx,%rax,1)
  35:	48 89 44 24 30       	mov    %rax,0x30(%rsp)
  3a:	4d 63 f5             	movslq %r13d,%r14
  3d:	42                   	rex.X
  3e:	c6                   	.byte 0xc6
  3f:	44                   	rex.R


---
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@...glegroups.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ