general protection fault in percpu_counter_add_batch

8 views
Skip to first unread message

syzbot

unread,
Oct 14, 2022, 10:19:42 PM10/14/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1345e3b2880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=5e96b2e8a574cd6a8808
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz

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

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: 15863 Comm: syz-executor.4 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:ffff8880529e7808 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 0000000000000010 RCX: ffffc90008418000
RDX: 0000000000000027 RSI: ffffffff83771e31 RDI: 0000000000000005
RBP: 00000000000000e8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000138 R15: ffff8880436d1880
FS: 00007fb56d52a700(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb56ecd90b0 CR3: 000000008fb0e000 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:0x7fb56ebb75a9
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb56d52a168 EFLAGS: 00000246 ORIG_RAX: 000000000000004c
RAX: ffffffffffffffda RBX: 00007fb56ecd7f80 RCX: 00007fb56ebb75a9
RDX: 0000000000000000 RSI: 0000000000000300 RDI: 0000000020002780
RBP: 00007fb56ec12580 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffda87e0e0f R14: 00007fb56d52a300 R15: 0000000000022000
Modules linked in:
---[ end trace 0c6e3c28dd7788d1 ]---
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:ffff8880529e7808 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 0000000000000010 RCX: ffffc90008418000
RDX: 0000000000000027 RSI: ffffffff83771e31 RDI: 0000000000000005
RBP: 00000000000000e8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000138 R15: ffff8880436d1880
FS: 00007fb56d52a700(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb56ecd90b0 CR3: 000000008fb0e000 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


---
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

unread,
Oct 14, 2022, 10:28:44 PM10/14/22
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1089332a880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=5e96b2e8a574cd6a8808
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=104fd806880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1203a244880000
mounted in repro: https://storage.googleapis.com/syzbot-assets/6ff4b4877a17/mount_0.gz

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

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