syzbot


KASAN: use-after-free Read in inet_create

Status: auto-closed as invalid on 2020/02/15 10:53
Reported-by: syzbot+c4baef56155e3a738f28@syzkaller.appspotmail.com
First crash: 980d, last: 980d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in inet_create 445 1492d 1658d 0/22 closed as dup on 2018/04/09 01:05
upstream KASAN: use-after-free Read in inet_create (2) 2 1422d 1439d 0/22 auto-closed as invalid on 2019/02/22 10:22

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in inet_create net/ipv4/af_inet.c:337 [inline]
BUG: KASAN: use-after-free in inet_create+0xc31/0xca0 net/ipv4/af_inet.c:244
Read of size 4 at addr ffff88805dc0c744 by task syz-executor.3/6905

CPU: 1 PID: 6905 Comm: syz-executor.3 Not tainted 4.14.150 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x138/0x197 lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429
 inet_create net/ipv4/af_inet.c:337 [inline]
 inet_create+0xc31/0xca0 net/ipv4/af_inet.c:244
 __sock_create+0x2f6/0x620 net/socket.c:1275
 sock_create net/socket.c:1315 [inline]
 SYSC_socket net/socket.c:1345 [inline]
 SyS_socket+0xd3/0x170 net/socket.c:1325
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45c5a7
RSP: 002b:00007fff0e4ff268 EFLAGS: 00000246
 ORIG_RAX: 0000000000000029
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045c5a7
RDX: 0000000000000006 RSI: 0000000000000001 RDI: 0000000000000002
RBP: 00000000000003ca R08: 0000000000000000 R09: 000000000000000a
R10: 0000000000000075 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff0e4ff980 R14: 000000000008629b R15: 00007fff0e4ff990

Allocated by task 17045:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:489
 kmem_cache_alloc+0x12e/0x780 mm/slab.c:3552
 getname_flags fs/namei.c:138 [inline]
 getname_flags+0xcb/0x580 fs/namei.c:128
 user_path_at_empty+0x2f/0x50 fs/namei.c:2630
 user_path_at include/linux/namei.h:57 [inline]
 vfs_statx+0xcd/0x160 fs/stat.c:185
 vfs_stat include/linux/fs.h:3060 [inline]
 SYSC_newstat+0x95/0x100 fs/stat.c:337
 SyS_newstat+0x1e/0x30 fs/stat.c:333
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 17045:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kmem_cache_free+0x83/0x2b0 mm/slab.c:3758
 putname+0xdb/0x120 fs/namei.c:259
 filename_lookup+0x23a/0x380 fs/namei.c:2385
 user_path_at_empty+0x43/0x50 fs/namei.c:2630
 user_path_at include/linux/namei.h:57 [inline]
 vfs_statx+0xcd/0x160 fs/stat.c:185
 vfs_stat include/linux/fs.h:3060 [inline]
 SYSC_newstat+0x95/0x100 fs/stat.c:337
 SyS_newstat+0x1e/0x30 fs/stat.c:333
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff88805dc0c580
 which belongs to the cache names_cache of size 4096
The buggy address is located 452 bytes inside of
 4096-byte region [ffff88805dc0c580, ffff88805dc0d580)
The buggy address belongs to the page:
page:ffffea0001770300 count:1 mapcount:0 mapping:ffff88805dc0c580 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000008100(slab|head)
raw: 01fffc0000008100 ffff88805dc0c580 0000000000000000 0000000100000001
raw: ffffea00016db2a0 ffffea00017703a0 ffff8880aa9e0cc0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88805dc0c600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805dc0c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805dc0c700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff88805dc0c780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805dc0c800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2019/10/18 10:52 linux-4.14.y b98aebd29824 8c88c9c1 .config log report