syzbot


KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put

Status: closed as dup on 2022/01/24 11:42
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+5027de09e0964fd78ce1@syzkaller.appspotmail.com
First crash: 1148d, last: 1101d
Cause bisection: introduced by (bisect log) [no-op commit]:
commit a7bdb9a9767360c2b4096bbb379e73022b274483
Author: Uwe Kleine-KΓΆnig <u.kleine-koenig@pengutronix.de>
Date: Tue Jul 13 19:35:19 2021 +0000

  s390/cio: Make struct css_driver::remove return void

Crash: BUG: sleeping function called from invalid context in lock_sock_nested (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit 218d747a4142f281a256687bb513a135c905867b
Author: John Fastabend <john.fastabend@gmail.com>
Date: Tue Jan 4 21:46:45 2022 +0000

  bpf, sockmap: Fix double bpf_prog_put on error case in map_link

  
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: vmalloc-out-of-bounds Read in bpf_prog_put bpf C done 2 1103d 1102d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put 3 (6) 2022/05/19 15:01

Sample crash report:
==================================================================
BUG: KASAN: vmalloc-out-of-bounds in __bpf_prog_put.constprop.0+0x1dd/0x220 kernel/bpf/syscall.c:1812 kernel/bpf/syscall.c:1812
Read of size 8 at addr ffffc900010b6038 by task syz-executor864/4623

CPU: 0 PID: 4623 Comm: syz-executor864 Not tainted 5.16.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 __dump_stack lib/dump_stack.c:88 [inline] lib/dump_stack.c:106
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0xf/0x320 mm/kasan/report.c:247 mm/kasan/report.c:247
 __kasan_report mm/kasan/report.c:433 [inline]
 __kasan_report mm/kasan/report.c:433 [inline] mm/kasan/report.c:450
 kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 mm/kasan/report.c:450
 __bpf_prog_put.constprop.0+0x1dd/0x220 kernel/bpf/syscall.c:1812 kernel/bpf/syscall.c:1812
 bpf_prog_put kernel/bpf/syscall.c:1829 [inline]
 bpf_prog_put kernel/bpf/syscall.c:1829 [inline] kernel/bpf/syscall.c:1837
 bpf_prog_release+0x33/0x40 kernel/bpf/syscall.c:1837 kernel/bpf/syscall.c:1837
 __fput+0x286/0x9f0 fs/file_table.c:280 fs/file_table.c:280
 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 exit_task_work include/linux/task_work.h:32 [inline] kernel/exit.c:832
 do_exit+0xc14/0x2b40 kernel/exit.c:832 kernel/exit.c:832
 do_group_exit+0x125/0x310 kernel/exit.c:929 kernel/exit.c:929
 __do_sys_exit_group kernel/exit.c:940 [inline]
 __se_sys_exit_group kernel/exit.c:938 [inline]
 __do_sys_exit_group kernel/exit.c:940 [inline] kernel/exit.c:938
 __se_sys_exit_group kernel/exit.c:938 [inline] kernel/exit.c:938
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:938 kernel/exit.c:938
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_x64 arch/x86/entry/common.c:50 [inline] arch/x86/entry/common.c:80
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fce59235d39
Code: Unable to access opcode bytes at RIP 0x7fce59235d0f.
RSP: 002b:00007ffea25b4cc8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007fce592aa330 RCX: 00007fce59235d39
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffffffffffc0 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000246 R12: 00007fce592aa330
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
 </TASK>


Memory state around the buggy address:
 ffffc900010b5f00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc900010b5f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc900010b6000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
                                        ^
 ffffc900010b6080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc900010b6100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================

Crashes (41):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/12/20 16:48 net-old 662f11d55ffd 021b36cb .config console log report syz C ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/18 00:16 net-old 8ca4090fec02 44068e19 .config console log report syz C ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/17 09:47 net-old 6441998e2e37 44068e19 .config console log report syz C ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/13 22:35 net-old 28a2686c185e 49ca1f59 .config console log report syz C ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/13 17:41 net-old 28a2686c185e 49ca1f59 .config console log report syz C ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/08 03:53 net-old 2a62df369271 0230ba3e .config console log report syz C ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/18 00:11 net-next-old 86df8be67f6c 44068e19 .config console log report syz C ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/17 14:34 net-next-old 7cd2802d7496 44068e19 .config console log report syz C ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/17 06:40 net-next-old 7cd2802d7496 44068e19 .config console log report syz C ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/13 19:19 net-next-old 9b5bcb193a3b 49ca1f59 .config console log report syz C ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/13 14:26 net-next-old 9b5bcb193a3b 49ca1f59 .config console log report syz C ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/07 17:35 net-next-old 1c5526968e27 0230ba3e .config console log report syz C ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/17 21:04 upstream 6441998e2e37 44068e19 .config console log report syz C ci-upstream-kasan-gce-root KASAN: out-of-bounds Read in __bpf_prog_put
2021/12/20 08:47 net-next-old 434ed2138994 021b36cb .config console log report syz ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/19 18:25 net-old 60ec7fcfe768 44068e19 .config console log report info ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/19 15:23 net-old 60ec7fcfe768 44068e19 .config console log report info ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/19 06:34 net-old 60ec7fcfe768 44068e19 .config console log report info ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/17 14:10 net-old 6441998e2e37 44068e19 .config console log report info ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/12 11:28 net-old ee60e626d536 49ca1f59 .config console log report info ci-upstream-net-this-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/21 11:34 net-next-old f7a5319b4477 62bd192b .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/20 19:28 net-next-old 4b430f5c9680 62bd192b .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/20 09:42 net-next-old 434ed2138994 021b36cb .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/19 07:00 net-next-old f85b244ee395 44068e19 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/17 16:49 net-next-old 86df8be67f6c 44068e19 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/16 07:51 net-next-old 3bc14ea0d12a 572bcb40 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/16 07:10 net-next-old 3bc14ea0d12a 572bcb40 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/13 05:22 net-next-old 8c8b7aa7fb0c 49ca1f59 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/08 06:34 net-next-old 150791442e7c 0230ba3e .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/07 15:53 net-next-old 1c5526968e27 0230ba3e .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/06 21:53 net-next-old ce83278f313c 579a8754 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/06 10:59 net-next-old ce83278f313c 579a8754 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/06 07:10 net-next-old ce83278f313c a617004c .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/05 20:08 net-next-old ce83278f313c a617004c .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/05 14:23 net-next-old ce83278f313c a617004c .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/05 00:03 net-next-old ce83278f313c a617004c .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/04 23:18 net-next-old ce83278f313c a617004c .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/04 16:34 net-next-old ce83278f313c a617004c .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/03 00:33 net-next-old fc993be36f9e 61f86278 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/02 14:44 net-next-old ce8299b6f76f 61f86278 .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/11/04 04:25 net-next-old cc0356d6a02e 4c1be0be .config console log report info ci-upstream-net-kasan-gce KASAN: vmalloc-out-of-bounds Read in __bpf_prog_put
2021/12/03 12:56 net-next-old 43332cf97425 c7c20675 .config console log report info ci-upstream-net-kasan-gce BUG: unable to handle kernel paging request in __bpf_prog_put
* Struck through repros no longer work on HEAD.