syzbot


KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch

Status: closed as invalid on 2022/11/15 21:09
Subsystems: bpf
[Documentation on labels]
First crash: 1178d, last: 611d
Cause bisection: introduced by (bisect log) [merge commit]:
commit d635a69dd4981cc51f90293f5f64268620ed1565
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Tue Dec 15 21:22:29 2020 +0000

  Merge tag 'net-next-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next

Crash: KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch (log)
Repro: syz .config
  
Fix bisection: fixed by (bisect log) :
commit 2775da21628738ce073a3a6a806adcbaada0f091
Author: Hou Tao <houtao1@huawei.com>
Date: Wed Aug 31 04:26:27 2022 +0000

  bpf: Disable preemption when increasing per-cpu map_locked

  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch 1 517d 517d 0/2 auto-obsoleted due to no activity on 2023/03/13 22:30
Fix bisection attempts (9)
Created Duration User Patch Repo Result
2022/10/12 17:51 5h14m (2) bisect fix upstream job log (1)
2022/08/22 21:49 22m bisect fix upstream job log (0) log
2022/07/18 23:56 21m bisect fix upstream job log (0) log
2022/06/18 23:36 20m bisect fix upstream job log (0) log
2022/05/18 23:24 19m bisect fix upstream job log (0) log
2022/04/18 23:05 18m bisect fix upstream job log (0) log
2022/03/19 22:46 18m bisect fix upstream job log (0) log
2022/02/17 22:25 21m bisect fix upstream job log (0) log
2022/01/18 19:36 20m bisect fix upstream job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in instrument_copy_to_user include/linux/instrumented.h:118 [inline]
BUG: KASAN: slab-out-of-bounds in _copy_to_user lib/usercopy.c:32 [inline]
BUG: KASAN: slab-out-of-bounds in _copy_to_user+0xc7/0x150 lib/usercopy.c:26
Read of size 42 at addr ffff8880180e6200 by task syz-executor926/8425

CPU: 0 PID: 8425 Comm: syz-executor926 Not tainted 5.12.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232
 __kasan_report mm/kasan/report.c:399 [inline]
 kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416
 check_region_inline mm/kasan/generic.c:180 [inline]
 kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186
 instrument_copy_to_user include/linux/instrumented.h:118 [inline]
 _copy_to_user lib/usercopy.c:32 [inline]
 _copy_to_user+0xc7/0x150 lib/usercopy.c:26
 copy_to_user include/linux/uaccess.h:200 [inline]
 __htab_map_lookup_and_delete_batch+0xef4/0x1860 kernel/bpf/hashtab.c:1588
 bpf_map_do_batch+0x3d5/0x510 kernel/bpf/syscall.c:4001
 __do_sys_bpf+0x1be4/0x4f40 kernel/bpf/syscall.c:4453
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x445ac9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 90 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:00007f6ef742d2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00000000004cb410 RCX: 0000000000445ac9
RDX: 0000000000000038 RSI: 0000000020000080 RDI: 0000000000000019
RBP: 000000000049a8f0 R08: 00007f6ef742d700 R09: 0000000000000000
R10: 00007f6ef742d700 R11: 0000000000000246 R12: 00000000200031c0
R13: 000000000049a078 R14: 00000000200021c0 R15: 00000000004cb418

Allocated by task 8425:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:427 [inline]
 ____kasan_kmalloc mm/kasan/common.c:506 [inline]
 ____kasan_kmalloc mm/kasan/common.c:465 [inline]
 __kasan_kmalloc+0x99/0xc0 mm/kasan/common.c:515
 kmalloc_node include/linux/slab.h:577 [inline]
 kvmalloc_node+0x61/0xf0 mm/util.c:587
 kvmalloc include/linux/mm.h:785 [inline]
 __htab_map_lookup_and_delete_batch+0x513/0x1860 kernel/bpf/hashtab.c:1467
 bpf_map_do_batch+0x3d5/0x510 kernel/bpf/syscall.c:4001
 __do_sys_bpf+0x1be4/0x4f40 kernel/bpf/syscall.c:4453
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae

The buggy address belongs to the object at ffff8880180e6200
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 0 bytes inside of
 64-byte region [ffff8880180e6200, ffff8880180e6240)
The buggy address belongs to the page:
page:ffffea0000603980 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x180e6
flags: 0xfff00000000200(slab)
raw: 00fff00000000200 ffffea0005055900 0000000d0000000d ffff888010441640
raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880180e6100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff8880180e6180: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
>ffff8880180e6200: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc
                               ^
 ffff8880180e6280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880180e6300: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Crashes (121):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/04/01 22:18 net-old 622d13694b5f 6a81331a .config console log report syz C ci-upstream-net-this-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/04/01 18:51 net-next-old 040806343bb4 6a81331a .config console log report syz C ci-upstream-net-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/03/05 14:12 net-next-old d310ec03a34e 9d751681 .config console log report syz ci-upstream-net-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/12/19 19:36 upstream 3f667b5d4053 44068e19 .config console log report syz C ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/12/09 23:15 upstream c741e49150db b54aa474 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/12/09 13:21 upstream 2a987e65025e b54aa474 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/12/02 03:04 upstream 58e1100fdc59 61f86278 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/30 12:32 upstream d58071a8a76d 80270552 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/28 23:53 upstream d06c942efea4 63eeac02 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/28 20:36 upstream 3498e7f2bb41 63eeac02 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/28 09:00 upstream 3498e7f2bb41 63eeac02 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/27 20:24 upstream 741392771338 63eeac02 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/25 18:13 upstream 5f53fa508db0 63eeac02 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/25 11:43 upstream 5f53fa508db0 545ab074 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/24 11:11 upstream 5d9f4cf36721 545ab074 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/21 15:57 upstream 923dcc5eb0c1 4eb20a4e .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/17 17:17 upstream ee1703cda8dc cafff8b6 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/16 18:25 upstream 8ab774587903 600426bd .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/15 13:50 upstream fa55b7dcdc43 83f5c9b5 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/14 22:55 upstream ce49bfc8d037 83f5c9b5 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/02 03:43 upstream 8bb7eca972ad 098b5d53 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/31 08:16 upstream 119c85055d86 098b5d53 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/29 06:10 upstream 411a44c24a56 2353a3ec .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/27 14:04 upstream d25f27432f80 373bf66b .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/25 07:15 upstream 87066fdd2e30 4f0000ee .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/21 12:01 upstream 2f111a6fd5b5 f111d03b .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/18 21:15 upstream cf52ad5ff16c 0c5d9412 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/17 17:27 upstream d999ade1cc86 0c5d9412 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/27 22:05 upstream 5816b3e6577e 78494d16 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/25 22:57 upstream a5e0aceabef6 8cac236e .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/25 16:59 upstream 7d42e9818258 8cac236e .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/19 01:12 upstream 93ff9f13be91 70b76c1d .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/17 10:45 upstream bdb575f87217 5b989942 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/11 02:22 upstream 926de8c4326c 5ae8508a .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/09 16:10 upstream a3fa7a101dcf e2776ee4 .config console log report info ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/03 10:29 upstream a9c9a6f741cd f62a5829 .config console log report info ci-upstream-kasan-gce-smack-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/01 03:28 upstream b91db6a0b52e 7eb7e152 .config console log report info ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/07/15 17:14 upstream 8096acd7442e a44e4957 .config console log report info ci-qemu-upstream-386 KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/12/03 08:52 net-old a51e3ac43ddb 61f86278 .config console log report info ci-upstream-net-this-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/12/02 17:36 net-old a37a0ee4d25c 61f86278 .config console log report info ci-upstream-net-this-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/20 19:52 bpf 732b74d64704 418a00eb .config console log report info ci-upstream-bpf-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/20 05:37 bpf 732b74d64704 466b7db1 .config console log report info ci-upstream-bpf-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/04 23:03 bpf b0e875bac0fa ce697b49 .config console log report info ci-upstream-bpf-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/18 19:47 bpf bc23f7244817 70b76c1d .config console log report info ci-upstream-bpf-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/02/02 00:38 net-old eb4e8fac00d1 e6b95f32 .config console log report info ci-upstream-net-this-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/24 09:54 net-next-old 91eddd309c67 545ab074 .config console log report info ci-upstream-net-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/11/01 20:17 net-next-old c07c6e8eb4b3 098b5d53 .config console log report info ci-upstream-net-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/29 20:14 bpf-next f48ad69097fe 098b5d53 .config console log report info ci-upstream-bpf-next-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/10/23 21:24 bpf-next c825f5fee19c 282f03fb .config console log report info ci-upstream-bpf-next-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/28 04:25 net-next-old b69c99463d41 78494d16 .config console log report info ci-upstream-net-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/18 09:11 bpf-next ca21a3e5edfd 70b76c1d .config console log report info ci-upstream-bpf-next-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/18 06:24 bpf-next ca21a3e5edfd 70b76c1d .config console log report info ci-upstream-bpf-next-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/16 14:29 net-next-old 52583c8d8b12 aae492f2 .config console log report info ci-upstream-net-kasan-gce KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
2021/09/16 23:11 linux-next 368847b165bb aae492f2 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch
* Struck through repros no longer work on HEAD.