syzbot


KASAN: use-after-free Read in bpf_tcp_remove

Status: upstream: reported C repro on 2019/06/09 01:18
Reported-by: syzbot+faa4eda7d7f7cfa5a2de@syzkaller.appspotmail.com
First crash: 1782d, last: 419d
Fix bisection: failed (error log, bisect log)
  
Fix bisection attempts (22)
Created Duration User Patch Repo Result
2021/10/31 00:01 15m bisect fix linux-4.19.y error job log (0)
2021/09/23 09:47 39m bisect fix linux-4.19.y job log (0) log
2021/08/24 09:02 38m bisect fix linux-4.19.y job log (0) log
2021/07/25 04:21 35m bisect fix linux-4.19.y job log (0) log
2021/06/25 02:00 33m bisect fix linux-4.19.y job log (0) log
2021/05/26 01:18 42m bisect fix linux-4.19.y job log (0) log
2021/04/26 00:39 38m bisect fix linux-4.19.y job log (0) log
2021/03/26 14:27 31m bisect fix linux-4.19.y job log (0) log
2021/02/24 13:52 34m bisect fix linux-4.19.y job log (0) log
2021/01/30 05:22 1m bisect fix linux-4.19.y error job log (0)
2020/12/31 04:17 34m bisect fix linux-4.19.y job log (0) log
2020/11/09 00:06 34m bisect fix linux-4.19.y job log (0) log
2020/10/09 22:17 33m bisect fix linux-4.19.y job log (0) log
2020/08/13 00:27 38m bisect fix linux-4.19.y job log (0) log
2020/07/13 16:17 37m bisect fix linux-4.19.y job log (0) log
2020/06/13 14:42 37m bisect fix linux-4.19.y job log (0) log
2020/05/14 14:02 40m bisect fix linux-4.19.y job log (0) log
2020/04/14 13:24 37m bisect fix linux-4.19.y job log (0) log
2020/03/15 12:44 39m bisect fix linux-4.19.y job log (0) log
2020/02/14 11:01 38m bisect fix linux-4.19.y job log (0) log
2020/01/15 10:22 38m bisect fix linux-4.19.y job log (0) log
2019/12/16 09:25 37m bisect fix linux-4.19.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3295
Read of size 8 at addr ffff8880a8ebdbf8 by task syz-executor239/10246

CPU: 0 PID: 10246 Comm: syz-executor239 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3295
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
 _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:168
 bpf_tcp_remove+0x427/0xa00 kernel/bpf/sockmap.c:335
 bpf_tcp_close+0x12b/0x390 kernel/bpf/sockmap.c:403
 inet_release+0xd7/0x1e0 net/ipv4/af_inet.c:427
 __sock_release+0xcd/0x2a0 net/socket.c:599
 sock_close+0x15/0x20 net/socket.c:1214
 __fput+0x2ce/0x890 fs/file_table.c:278
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xbf3/0x2be0 kernel/exit.c:870
 do_group_exit+0x125/0x310 kernel/exit.c:967
 __do_sys_exit_group kernel/exit.c:978 [inline]
 __se_sys_exit_group kernel/exit.c:976 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:976
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f82ccbf1d99
Code: 00 49 c7 c0 c0 ff ff ff be e7 00 00 00 ba 3c 00 00 00 eb 12 0f 1f 44 00 00 89 d0 0f 05 48 3d 00 f0 ff ff 77 1c f4 89 f0 0f 05 <48> 3d 00 f0 ff ff 76 e7 f7 d8 64 41 89 00 eb df 0f 1f 80 00 00 00
RSP: 002b:00007ffea89a73b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f82ccc66330 RCX: 00007f82ccbf1d99
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffffffffffc0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f82ccc66330
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001

Allocated by task 10246:
 kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 kzalloc include/linux/slab.h:709 [inline]
 sock_map_alloc kernel/bpf/sockmap.c:1675 [inline]
 sock_map_alloc+0x2b8/0x510 kernel/bpf/sockmap.c:1657
 find_and_alloc_map kernel/bpf/syscall.c:130 [inline]
 map_create kernel/bpf/syscall.c:510 [inline]
 __do_sys_bpf kernel/bpf/syscall.c:2408 [inline]
 __se_sys_bpf+0x82a/0x3a20 kernel/bpf/syscall.c:2384
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 8117:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 process_one_work+0x864/0x1570 kernel/workqueue.c:2153
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff8880a8ebdac0
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 312 bytes inside of
 512-byte region [ffff8880a8ebdac0, ffff8880a8ebdcc0)
The buggy address belongs to the page:
page:ffffea0002a3af40 count:1 mapcount:0 mapping:ffff88813bff0940 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea0002a3afc8 ffffea0002a20088 ffff88813bff0940
raw: 0000000000000000 ffff8880a8ebd0c0 0000000100000006 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a8ebda80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff8880a8ebdb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880a8ebdb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff8880a8ebdc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880a8ebdc80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Crashes (45):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/02/23 04:34 linux-4.19.y 3f8a27f9e27b 9f1e2cb3 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/10/24 00:15 linux-4.19.y 3f8a27f9e27b 23bf86af .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/10/16 05:29 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/10/16 03:05 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/10/15 23:33 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/10/15 20:10 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report syz C [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/07/31 07:54 linux-4.19.y 3f8a27f9e27b fef302b1 .config console log report syz ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2020/12/01 04:17 linux-4.19.y 0c88e405c97e b3a34598 .config console log report syz ci2-linux-4-19
2019/07/31 19:12 linux-4.19.y 9a9de33a9dfa 995b2a26 .config console log report syz ci2-linux-4-19
2019/06/09 00:17 linux-4.19.y e109a984cf38 0159583c .config console log report syz ci2-linux-4-19
2023/03/02 09:33 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2023/02/21 10:31 linux-4.19.y 3f8a27f9e27b f949448d .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2023/01/29 22:28 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2023/01/27 08:10 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2023/01/16 15:52 linux-4.19.y 3f8a27f9e27b a63719e7 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/10/31 19:08 linux-4.19.y 3f8a27f9e27b 2a71366b .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/10/18 21:11 linux-4.19.y 3f8a27f9e27b b31320fc .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/09/27 11:36 linux-4.19.y 3f8a27f9e27b 10323ddf .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/09/25 13:25 linux-4.19.y 3f8a27f9e27b 0042f2b4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/09/23 22:08 linux-4.19.y 3f8a27f9e27b 0042f2b4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/09/16 19:11 linux-4.19.y 3f8a27f9e27b dd9a85ff .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/09/05 00:01 linux-4.19.y 3f8a27f9e27b 28811d0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/09/04 22:05 linux-4.19.y 3f8a27f9e27b 28811d0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/08/19 13:15 linux-4.19.y 3f8a27f9e27b 26a13b38 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/08/10 12:52 linux-4.19.y 3f8a27f9e27b aaa9eaa0 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/08/05 19:33 linux-4.19.y 3f8a27f9e27b a65a7ce9 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/07/31 07:28 linux-4.19.y 3f8a27f9e27b fef302b1 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/07/28 18:44 linux-4.19.y 3f8a27f9e27b fb95c74d .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/07/25 14:43 linux-4.19.y 3f8a27f9e27b 664c519c .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/07/16 22:41 linux-4.19.y 3f8a27f9e27b 95cb00d1 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/07/07 10:32 linux-4.19.y 3f8a27f9e27b bff65f44 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/05/21 19:52 linux-4.19.y 3f8a27f9e27b 7268fa62 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/05/21 05:31 linux-4.19.y 3f8a27f9e27b 7268fa62 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/04/30 17:59 linux-4.19.y 3f8a27f9e27b 2df221f6 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/04/22 09:43 linux-4.19.y 3f8a27f9e27b 2738b391 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/03/27 17:16 linux-4.19.y 3f8a27f9e27b 89bc8608 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/03/19 16:45 linux-4.19.y 3f8a27f9e27b e2d91b1d .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/03/13 14:20 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/03/12 01:57 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/03/04 01:35 linux-4.19.y 3f8a27f9e27b 45a13a73 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2022/02/21 16:32 linux-4.19.y 3f8a27f9e27b 3cd800e4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in bpf_tcp_remove
2023/01/25 05:58 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Write in bpf_tcp_remove
2023/01/06 01:59 linux-4.19.y 3f8a27f9e27b 1dac8c7a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Write in bpf_tcp_remove
2020/12/01 00:14 linux-4.19.y 0c88e405c97e b3a34598 .config console log report info ci2-linux-4-19
2020/09/09 18:09 linux-4.19.y 67957f12548c ac7ca78e .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.