syzbot


KASAN: use-after-free Read in sock_release (2)

Status: closed as invalid on 2018/04/10 15:17
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+b1e23e45b86dbd071d35@syzkaller.appspotmail.com
First crash: 2229d, last: 2229d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in sock_release net 1 2355d 2351d 4/26 fixed on 2018/02/14 17:41

Sample crash report:
IPVS: set_ctl: invalid protocol: 0 0.0.0.0:0 dhýÿÿýÿÿÿÿ
==================================================================
BUG: KASAN: use-after-free in sock_release+0x1bc/0x1e0 net/socket.c:600
Read of size 8 at addr ffff8801d8f03408 by task syz-executor6/9411

CPU: 1 PID: 9411 Comm: syz-executor6 Not tainted 4.16.0-rc7+ #282
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+0x194/0x24d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 sock_release+0x1bc/0x1e0 net/socket.c:600
 sock_close+0x16/0x20 net/socket.c:1149
 __fput+0x327/0x7e0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:243
 task_work_run+0x199/0x270 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x9bb/0x1ad0 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 SYSC_exit_group kernel/exit.c:979 [inline]
 SyS_exit_group+0x1d/0x20 kernel/exit.c:977
 do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
 do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392
 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7f02c99
RSP: 002b:000000000844ea8c EFLAGS: 00000206 ORIG_RAX: 00000000000000fc
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000013 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 9415:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
 kmem_cache_alloc_trace+0x136/0x740 mm/slab.c:3608
 kmalloc include/linux/slab.h:512 [inline]
 sock_alloc_inode+0xb4/0x300 net/socket.c:247
 alloc_inode+0x65/0x180 fs/inode.c:209
 new_inode_pseudo+0x69/0x190 fs/inode.c:890
 sock_alloc+0x41/0x270 net/socket.c:565
 __sock_create+0x148/0x850 net/socket.c:1249
 sock_create net/socket.c:1325 [inline]
 SYSC_socket net/socket.c:1355 [inline]
 SyS_socket+0xeb/0x1d0 net/socket.c:1335
 do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
 do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392
 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139

Freed by task 4530:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
 __cache_free mm/slab.c:3486 [inline]
 kfree+0xd9/0x260 mm/slab.c:3801
 __rcu_reclaim kernel/rcu/rcu.h:167 [inline]
 rcu_do_batch kernel/rcu/tree.c:2674 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2933 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2900 [inline]
 rcu_process_callbacks+0xe94/0x17f0 kernel/rcu/tree.c:2917
 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285

The buggy address belongs to the object at ffff8801d8f033c0
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 72 bytes inside of
 128-byte region [ffff8801d8f033c0, ffff8801d8f03440)
The buggy address belongs to the page:
page:ffffea000763c0c0 count:1 mapcount:0 mapping:ffff8801d8f03000 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801d8f03000 0000000000000000 0000000100000015
raw: ffffea000763bfa0 ffffea0007391e60 ffff8801dac00640 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801d8f03300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801d8f03380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff8801d8f03400: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                      ^
 ffff8801d8f03480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801d8f03500: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/31 02:37 upstream 9dd2326890d8 8fbce0e4 .config console log report ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.