syzbot
general protection fault in percpu_counter_add_batch
Status:
upstream: reported C repro on 2022/10/15 02:19
Reported-by: syzbot+5e96b2e8a574cd6a8808@syzkaller.appspotmail.com
First crash: 1400d, last: 1260d
Sample crash report:
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/09/12 12:00 (1000)
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 8089 Comm: syz-executor281 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
RIP: 0010:percpu_counter_add_batch+0x47/0x180 lib/percpu_counter.c:87
Code: 01 00 00 00 e8 7a 16 ba fd 4c 8d 75 50 48 c7 c7 40 1c b6 88 e8 da c8 ef ff 4c 89 f2 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 06 01 00 00 4c 8b 7d 50 65 45 8b 2f 4d 63 e5 4c
RSP: 0018:ffff888095a37808 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 0000000000000010 RCX: ffffffff83771e23
RDX: 0000000000000027 RSI: ffffffff83771e31 RDI: 0000000000000005
RBP: 00000000000000e8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000138 R15: ffff88808b857880
FS: 0000555556e5a300(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055570f486468 CR3: 00000000a93c7000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__add_wb_stat include/linux/backing-dev.h:70 [inline]
inc_wb_stat include/linux/backing-dev.h:75 [inline]
__test_set_page_writeback+0xf23/0x1750 mm/page-writeback.c:2783
set_page_writeback include/linux/page-flags.h:497 [inline]
__block_write_full_page+0xa74/0xf60 fs/buffer.c:1827
block_write_full_page+0x1f3/0x260 fs/buffer.c:2951
udf_expand_file_adinicb+0x59b/0xf40 fs/udf/inode.c:302
udf_setsize+0x621/0x1030 fs/udf/inode.c:1242
udf_setattr+0x33d/0x430 fs/udf/file.c:278
notify_change+0x70b/0xfc0 fs/attr.c:334
do_truncate+0x134/0x1f0 fs/open.c:63
vfs_truncate+0x54b/0x6d0 fs/open.c:109
do_sys_truncate fs/open.c:132 [inline]
do_sys_truncate+0x145/0x170 fs/open.c:120
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f434f10f379
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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd46a7aa08 EFLAGS: 00000246 ORIG_RAX: 000000000000004c
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f434f10f379
RDX: 00007f434f0cd683 RSI: 0000000000000300 RDI: 0000000020002780
RBP: 00007f434f0ce950 R08: 0000555556e5a2c0 R09: 0000000000000000
R10: 00007ffd46a7a8d0 R11: 0000000000000246 R12: 00007f434f0ce9e0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 418f2b44882fa4a3 ]---
RIP: 0010:percpu_counter_add_batch+0x47/0x180 lib/percpu_counter.c:87
Code: 01 00 00 00 e8 7a 16 ba fd 4c 8d 75 50 48 c7 c7 40 1c b6 88 e8 da c8 ef ff 4c 89 f2 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 06 01 00 00 4c 8b 7d 50 65 45 8b 2f 4d 63 e5 4c
RSP: 0018:ffff888095a37808 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 0000000000000010 RCX: ffffffff83771e23
RDX: 0000000000000027 RSI: ffffffff83771e31 RDI: 0000000000000005
RBP: 00000000000000e8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000138 R15: ffff88808b857880
FS: 0000555556e5a300(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055570f486468 CR3: 00000000a93c7000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 01 00 add %eax,(%rax)
2: 00 00 add %al,(%rax)
4: e8 7a 16 ba fd callq 0xfdba1683
9: 4c 8d 75 50 lea 0x50(%rbp),%r14
d: 48 c7 c7 40 1c b6 88 mov $0xffffffff88b61c40,%rdi
14: e8 da c8 ef ff callq 0xffefc8f3
19: 4c 89 f2 mov %r14,%rdx
1c: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
23: fc ff df
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction
2e: 0f 85 06 01 00 00 jne 0x13a
34: 4c 8b 7d 50 mov 0x50(%rbp),%r15
38: 65 45 8b 2f mov %gs:(%r15),%r13d
3c: 4d 63 e5 movslq %r13d,%r12
3f: 4c rex.WR
* Struck through repros no longer work on HEAD.