syzbot


KFENCE: out-of-bounds in do_check_common

Status: closed as invalid on 2021/02/18 11:31
Subsystems: bpf
[Documentation on labels]
First crash: 1149d, last: 1149d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in do_check_common bpf C done 5 630d 634d 22/26 fixed on 2023/02/24 13:50

Sample crash report:
==================================================================
BUG: KFENCE: out-of-bounds write in push_jmp_history kernel/bpf/verifier.c:1776 [inline]
BUG: KFENCE: out-of-bounds write in is_state_visited kernel/bpf/verifier.c:9321 [inline]
BUG: KFENCE: out-of-bounds write in do_check kernel/bpf/verifier.c:9461 [inline]
BUG: KFENCE: out-of-bounds write in do_check_common+0x3b89/0xd090 kernel/bpf/verifier.c:11570

Out-of-bounds write at 0xffff88823bc37004 (140B right of kfence-#26):
 push_jmp_history kernel/bpf/verifier.c:1776 [inline]
 is_state_visited kernel/bpf/verifier.c:9321 [inline]
 do_check kernel/bpf/verifier.c:9461 [inline]
 do_check_common+0x3b89/0xd090 kernel/bpf/verifier.c:11570
 do_check_main kernel/bpf/verifier.c:11636 [inline]
 bpf_check+0x900a/0xcbe0 kernel/bpf/verifier.c:12171
 bpf_prog_load+0xe47/0x1f40 kernel/bpf/syscall.c:2204
 __do_sys_bpf+0x1251/0x4f00 kernel/bpf/syscall.c:4382
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

kfence-#26 [0xffff88823bc36f78-0xffff88823bc36fff, size=136, cache=kmalloc-192] allocated by task 10993:
 __do_krealloc mm/slab_common.c:1157 [inline]
 krealloc+0x7e/0xd0 mm/slab_common.c:1190
 push_jmp_history kernel/bpf/verifier.c:1773 [inline]
 is_state_visited kernel/bpf/verifier.c:9321 [inline]
 do_check kernel/bpf/verifier.c:9461 [inline]
 do_check_common+0x3b2a/0xd090 kernel/bpf/verifier.c:11570
 do_check_main kernel/bpf/verifier.c:11636 [inline]
 bpf_check+0x900a/0xcbe0 kernel/bpf/verifier.c:12171
 bpf_prog_load+0xe47/0x1f40 kernel/bpf/syscall.c:2204
 __do_sys_bpf+0x1251/0x4f00 kernel/bpf/syscall.c:4382
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

CPU: 1 PID: 10993 Comm: syz-executor.4 Not tainted 5.11.0-rc6-next-20210202-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:push_jmp_history kernel/bpf/verifier.c:1776 [inline]
RIP: 0010:is_state_visited kernel/bpf/verifier.c:9321 [inline]
RIP: 0010:do_check kernel/bpf/verifier.c:9461 [inline]
RIP: 0010:do_check_common+0x3b89/0xd090 kernel/bpf/verifier.c:11570
Code: fe ff ff 49 8d 7c 24 04 8b 08 48 89 f8 48 c1 e8 03 0f b6 14 18 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 6f 59 00 00 <41> 89 4c 24 04 48 8b 8d 30 fe ff ff 48 89 c8 48 c1 e8 03 0f b6 14
RSP: 0018:ffffc90001bbf760 EFLAGS: 00010246
RAX: 0000000000000007 RBX: dffffc0000000000 RCX: 0000000000000007
RDX: 0000000000000000 RSI: ffffffff818432cb RDI: ffff88823bc37004
RBP: ffffc90001bbf990 R08: 0000000000000000 R09: 000000000000002e
R10: ffffffff8132a08a R11: 000000000000003f R12: ffff88823bc37000
R13: ffff88823bc36f78 R14: ffff8880275ffa68 R15: ffff8880275ffa70
FS:  00007f67fd8f8700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff88823bc37004 CR3: 0000000011eeb000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 do_check_main kernel/bpf/verifier.c:11636 [inline]
 bpf_check+0x900a/0xcbe0 kernel/bpf/verifier.c:12171
 bpf_prog_load+0xe47/0x1f40 kernel/bpf/syscall.c:2204
 __do_sys_bpf+0x1251/0x4f00 kernel/bpf/syscall.c:4382
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x465b09
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f67fd8f8188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465b09
RDX: 0000000000000048 RSI: 00000000200054c0 RDI: 0000000000000005
RBP: 00000000004b069f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60
R13: 00007ffe16c4060f R14: 00007f67fd8f8300 R15: 0000000000022000
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/02/03 09:31 linux-next fb2a9c320987 624dad51 .config console log report info ci-upstream-linux-next-kasan-gce-root KFENCE: out-of-bounds in do_check_common
2021/02/03 05:33 linux-next fb2a9c320987 624dad51 .config console log report info ci-upstream-linux-next-kasan-gce-root KFENCE: out-of-bounds in do_check_common
2021/02/03 03:26 linux-next fb2a9c320987 624dad51 .config console log report info ci-upstream-linux-next-kasan-gce-root KFENCE: out-of-bounds in do_check_common
2021/02/03 03:24 linux-next fb2a9c320987 624dad51 .config console log report info ci-upstream-linux-next-kasan-gce-root KFENCE: out-of-bounds in do_check_common
* Struck through repros no longer work on HEAD.