================================================================== BUG: KASAN: use-after-free in __fput+0x6b1/0x7f0 fs/file_table.c:212 Read of size 2 at addr ffff88003c74c9f0 by task syz-executor3/8371 CPU: 0 PID: 8371 Comm: syz-executor3 Not tainted 4.13.0-rc7-next-20170829+ #11 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 print_address_description+0x73/0x250 mm/kasan/report.c:252 ata1.00: non-matching transfer count (256/92) kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x24e/0x340 mm/kasan/report.c:409 __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:428 __fput+0x6b1/0x7f0 fs/file_table.c:212 ____fput+0x15/0x20 fs/file_table.c:246 task_work_run+0x199/0x270 kernel/task_work.c:112 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x2a6/0x300 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath+0x42f/0x500 arch/x86/entry/common.c:266 ata1.00: non-matching transfer count (256/92) entry_SYSCALL_64_fastpath+0xbc/0xbe RIP: 0033:0x446749 RSP: 002b:00007fe33ce84c08 EFLAGS: 00000296 ORIG_RAX: 0000000000000010 RAX: fffffffffffffff4 RBX: 0000000000000006 RCX: 0000000000446749 RDX: 0000000020b6cffc RSI: 00000000000089e2 RDI: 0000000000000006 RBP: 0000000000708000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000016 R13: 0000000000003380 R14: 00000000006e5440 R15: 00000000000089e2 Allocated by task 8371: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 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:551 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3561 sock_alloc_inode+0x70/0x300 net/socket.c:250 alloc_inode+0x65/0x180 fs/inode.c:208 new_inode_pseudo+0x69/0x190 fs/inode.c:890 sock_alloc+0x41/0x270 net/socket.c:565 kcm_clone net/kcm/kcmsock.c:1633 [inline] kcm_ioctl+0x82e/0x1590 net/kcm/kcmsock.c:1709 sock_do_ioctl+0x65/0xb0 net/socket.c:961 sock_ioctl+0x2c2/0x440 net/socket.c:1058 vfs_ioctl fs/ioctl.c:45 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685 SYSC_ioctl fs/ioctl.c:700 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 8371: QAT: Invalid ioctl save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x77/0x280 mm/slab.c:3763 sock_destroy_inode+0x56/0x70 net/socket.c:280 destroy_inode+0x15d/0x200 fs/inode.c:265 evict+0x57e/0x920 fs/inode.c:570 iput_final fs/inode.c:1515 [inline] iput+0x7b9/0xaf0 fs/inode.c:1542 sock_release+0x168/0x1e0 net/socket.c:607 sock_close+0x16/0x20 net/socket.c:1126 __fput+0x333/0x7f0 fs/file_table.c:210 ____fput+0x15/0x20 fs/file_table.c:246 task_work_run+0x199/0x270 kernel/task_work.c:112 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x2a6/0x300 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath+0x42f/0x500 arch/x86/entry/common.c:266 entry_SYSCALL_64_fastpath+0xbc/0xbe The buggy address belongs to the object at ffff88003c74c9c0 which belongs to the cache sock_inode_cache of size 1040 The buggy address is located 48 bytes inside of 1040-byte region [ffff88003c74c9c0, ffff88003c74cdd0) The buggy address belongs to the page: page:ffffea0000f1d300 count:1 mapcount:0 mapping:ffff88003c74c040 index:0xffff88003c74cffd flags: 0x100000000000100(slab) raw: 0100000000000100 ffff88003c74c040 ffff88003c74cffd 0000000100000003 raw: ffffea0000e54020 ffffea0000e54ea0 ffff88006d07f0c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88003c74c880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88003c74c900: fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88003c74c980: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88003c74ca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88003c74ca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================