syzbot


KASAN: vmalloc-out-of-bounds Write in bpf_lru_populate

Status: fixed on 2021/03/10 01:48
Subsystems: bpf
[Documentation on labels]
Fix commit: e1868b9e36d0 bpf: Avoid overflows involving hash elem_size
First crash: 1264d, last: 1254d
Cause bisection: introduced by (bisect log) [no-op commit]:
commit 024cd2cbd1ca2d29e6df538855d52c4e5990cab7
Author: Santucci Pierpaolo <santucci@epigenesys.com>
Date: Mon Nov 16 10:30:37 2020 +0000

  selftest/bpf: Fix IPV6FR handling in flow dissector

Crash: BUG: sleeping function called from invalid context in sta_info_move_state (log)
Repro: C syz .config
  

Sample crash report:
==================================================================
BUG: KASAN: vmalloc-out-of-bounds in bpf_common_lru_populate kernel/bpf/bpf_lru_list.c:569 [inline]
BUG: KASAN: vmalloc-out-of-bounds in bpf_lru_populate+0x56d/0x5e0 kernel/bpf/bpf_lru_list.c:614
Write of size 1 at addr ffffc9000ade1fba by task syz-executor328/8473

CPU: 1 PID: 8473 Comm: syz-executor328 Not tainted 5.10.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0x5/0x4c8 mm/kasan/report.c:385
 __kasan_report mm/kasan/report.c:545 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
 bpf_common_lru_populate kernel/bpf/bpf_lru_list.c:569 [inline]
 bpf_lru_populate+0x56d/0x5e0 kernel/bpf/bpf_lru_list.c:614
 prealloc_init kernel/bpf/hashtab.c:319 [inline]
 htab_map_alloc+0xf6e/0x1230 kernel/bpf/hashtab.c:507
 find_and_alloc_map kernel/bpf/syscall.c:123 [inline]
 map_create kernel/bpf/syscall.c:829 [inline]
 __do_sys_bpf+0xa81/0x5170 kernel/bpf/syscall.c:4374
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x4402d9
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 0f 83 7b 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff580768b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 00000000004402d9
RDX: 0000000000000040 RSI: 00000000200000c0 RDI: 0000000000000000
RBP: 00000000006ca018 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000401ae0
R13: 0000000000401b70 R14: 0000000000000000 R15: 0000000000000000


Memory state around the buggy address:
 ffffc9000ade1e80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc9000ade1f00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc9000ade1f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
                                        ^
 ffffc9000ade2000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc9000ade2080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================

Crashes (19):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/06 01:46 bpf-next 34da87213d3d 50503117 .config console log report syz C ci-upstream-bpf-next-kasan-gce
2020/12/13 22:08 net-next-old 13458ffe0a95 b22a7ec3 .config console log report info ci-upstream-net-kasan-gce
2020/12/13 22:07 net-next-old 13458ffe0a95 b22a7ec3 .config console log report info ci-upstream-net-kasan-gce
2020/12/13 22:07 net-next-old 13458ffe0a95 b22a7ec3 .config console log report info ci-upstream-net-kasan-gce
2020/12/13 21:36 net-next-old 13458ffe0a95 b22a7ec3 .config console log report info ci-upstream-net-kasan-gce
2020/12/12 23:45 net-next-old 00f7763a26cb bca53db9 .config console log report info ci-upstream-net-kasan-gce
2020/12/12 14:29 net-next-old 91163f821436 bca53db9 .config console log report info ci-upstream-net-kasan-gce
2020/12/09 01:46 net-next-old 8e98387b16b8 a7f7f4a4 .config console log report info ci-upstream-net-kasan-gce
2020/12/08 20:51 net-next-old 8e98387b16b8 a7f7f4a4 .config console log report info ci-upstream-net-kasan-gce
2020/12/07 17:51 bpf-next 34da87213d3d 1190297f .config console log report info ci-upstream-bpf-next-kasan-gce
2020/12/07 17:46 net-next-old af3f4a85d902 1190297f .config console log report info ci-upstream-net-kasan-gce
2020/12/07 08:04 bpf-next 34da87213d3d c521566d .config console log report info ci-upstream-bpf-next-kasan-gce
2020/12/07 07:45 net-next-old 4054eebf0fb0 c521566d .config console log report info ci-upstream-net-kasan-gce
2020/12/06 23:01 net-next-old 4054eebf0fb0 c521566d .config console log report info ci-upstream-net-kasan-gce
2020/12/06 21:01 bpf-next 34da87213d3d c521566d .config console log report info ci-upstream-bpf-next-kasan-gce
2020/12/06 05:19 net-next-old bcd684aace34 50503117 .config console log report info ci-upstream-net-kasan-gce
2020/12/06 05:16 bpf-next 34da87213d3d 50503117 .config console log report info ci-upstream-bpf-next-kasan-gce
2020/12/06 01:32 bpf-next 34da87213d3d 50503117 .config console log report info ci-upstream-bpf-next-kasan-gce
2020/12/03 12:39 bpf-next 97306be45fbe e6b0d314 .config console log report info ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.