BUG: unable to handle kernel NULL pointer dereference in get_block (2)

5 views
Skip to first unread message

syzbot

unread,
Dec 9, 2022, 3:52:40 AM12/9/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 65afe34ac33d Linux 4.14.301
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1003216b880000
kernel config: https://syzkaller.appspot.com/x/.config?x=5dfc73e3d697d68d
dashboard link: https://syzkaller.appspot.com/bug?extid=c896e28ce85bdbf20c04
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16418efb880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14add8eb880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/cba1bf735bc1/disk-65afe34a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/640415e88522/vmlinux-65afe34a.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8c2d360d5af4/bzImage-65afe34a.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/73162d4cf7bb/mount_1.gz

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

sysv_free_block: flc_count > flc_size
sysv_free_block: flc_count > flc_size
sysv_free_block: flc_count > flc_size
sysv_free_block: flc_count > flc_size
sysv_free_block: flc_count > flc_size
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: test_and_set_bit arch/x86/include/asm/bitops.h:220 [inline]
IP: test_and_set_bit_lock arch/x86/include/asm/bitops.h:234 [inline]
IP: trylock_buffer include/linux/buffer_head.h:401 [inline]
IP: lock_buffer include/linux/buffer_head.h:407 [inline]
IP: alloc_branch fs/sysv/itree.c:148 [inline]
IP: get_block+0x4ab/0x1230 fs/sysv/itree.c:251
PGD a6e15067 P4D a6e15067 PUD 9e63b067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
Modules linked in:
CPU: 1 PID: 7992 Comm: syz-executor122 Not tainted 4.14.301-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
task: ffff8880b4530280 task.stack: ffff8880b2df0000
RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:220 [inline]
RIP: 0010:test_and_set_bit_lock arch/x86/include/asm/bitops.h:234 [inline]
RIP: 0010:trylock_buffer include/linux/buffer_head.h:401 [inline]
RIP: 0010:lock_buffer include/linux/buffer_head.h:407 [inline]
RIP: 0010:alloc_branch fs/sysv/itree.c:148 [inline]
RIP: 0010:get_block+0x4ab/0x1230 fs/sysv/itree.c:251
RSP: 0018:ffff8880b2df77f8 EFLAGS: 00010246
RAX: 0000000000000007 RBX: ffff8880b2df7928 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 00000000ffffffff RDI: ffff8880b45302a4
RBP: ffff8880b2df79b0 R08: ffffea000238b400 R09: 0000000000000002
R10: 0000000000000000 R11: ffff8880b4530280 R12: 0000000000000000
R13: dffffc0000000000 R14: ffff88808dfae958 R15: 0000000054445f42
FS: 0000555556ab13c0(0000) GS:ffff8880ba500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000000a16f4000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__block_write_begin_int+0x35c/0x11d0 fs/buffer.c:2038
__block_write_begin fs/buffer.c:2088 [inline]
block_write_begin+0x58/0x270 fs/buffer.c:2147
sysv_write_begin+0x35/0xc0 fs/sysv/itree.c:485
generic_perform_write+0x1d5/0x430 mm/filemap.c:3055
__generic_file_write_iter+0x227/0x590 mm/filemap.c:3180
generic_file_write_iter+0x36f/0x650 mm/filemap.c:3208
call_write_iter include/linux/fs.h:1780 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x44c/0x630 fs/read_write.c:482
vfs_write+0x17f/0x4d0 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xf2/0x210 fs/read_write.c:582
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
RIP: 0033:0x7f57ae67aa49
RSP: 002b:00007ffeabc23b28 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f57ae67aa49
RDX: 00000000fffffd5e RSI: 000000002000ad00 RDI: 0000000000000004
RBP: 00007ffeabc23b80 R08: 00007ffeabc23ba0 R09: 00007ffeabc23ba0
R10: 0000000000009e07 R11: 0000000000000246 R12: 0000000000000003
R13: 00007ffeabc23b60 R14: 00007ffeabc23b58 R15: 00007ffeabc23ba0
Code: 0b 00 00 49 8b bc 24 28 01 00 00 b9 08 00 00 00 e8 fb 98 95 ff 31 d2 be 96 01 00 00 48 c7 c7 a0 63 aa 87 49 89 c4 e8 f5 a6 3b ff <f0> 49 0f ba 2c 24 02 0f 82 16 07 00 00 e8 93 c3 57 ff 4d 8d 7c
RIP: test_and_set_bit arch/x86/include/asm/bitops.h:220 [inline] RSP: ffff8880b2df77f8
RIP: test_and_set_bit_lock arch/x86/include/asm/bitops.h:234 [inline] RSP: ffff8880b2df77f8
RIP: trylock_buffer include/linux/buffer_head.h:401 [inline] RSP: ffff8880b2df77f8
RIP: lock_buffer include/linux/buffer_head.h:407 [inline] RSP: ffff8880b2df77f8
RIP: alloc_branch fs/sysv/itree.c:148 [inline] RSP: ffff8880b2df77f8
RIP: get_block+0x4ab/0x1230 fs/sysv/itree.c:251 RSP: ffff8880b2df77f8
CR2: 0000000000000000
---[ end trace 3d6c673a50a58217 ]---
----------------
Code disassembly (best guess):
0: 0b 00 or (%rax),%eax
2: 00 49 8b add %cl,-0x75(%rcx)
5: bc 24 28 01 00 mov $0x12824,%esp
a: 00 b9 08 00 00 00 add %bh,0x8(%rcx)
10: e8 fb 98 95 ff callq 0xff959910
15: 31 d2 xor %edx,%edx
17: be 96 01 00 00 mov $0x196,%esi
1c: 48 c7 c7 a0 63 aa 87 mov $0xffffffff87aa63a0,%rdi
23: 49 89 c4 mov %rax,%r12
26: e8 f5 a6 3b ff callq 0xff3ba720
* 2b: f0 49 0f ba 2c 24 02 lock btsq $0x2,(%r12) <-- trapping instruction
32: 0f 82 16 07 00 00 jb 0x74e
38: e8 93 c3 57 ff callq 0xff57c3d0
3d: 4d rex.WRB
3e: 8d .byte 0x8d
3f: 7c .byte 0x7c


---
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
Reply all
Reply to author
Forward
0 new messages