mapped:24345 shmem:330 pagetables:735 bounce:0 free:1391599 free_pcp:400 free_cma:0 Node 0 active_anon:390140kB inactive_anon:252kB active_file:14260kB inactive_file:34344kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:97380kB dirty:0kB writeback:0kB shmem:1320kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 159744kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no ================================================================== Node 0 BUG: KASAN: use-after-free in ucma_close+0x2d7/0x2f0 drivers/infiniband/core/ucma.c:1693 Read of size 8 at addr ffff8801d1cbb880 by task syz-executor7/9835 CPU: 0 PID: 9835 Comm: syz-executor7 Not tainted 4.16.0-rc5+ #357 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 DMA free:15908kB min:164kB low:204kB high:244kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:15992kB managed:15908kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB lowmem_reserve[]: 0 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 2864 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 ucma_close+0x2d7/0x2f0 drivers/infiniband/core/ucma.c:1693 6373 6373 __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 Node 0 DMA32 free:2934444kB min:30292kB low:37864kB high:45436kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:3129292kB managed:2935316kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:872kB local_pcp:688kB free_cma:0kB exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9bb/0x1ad0 kernel/exit.c:865 lowmem_reserve[]: 0 0 3509 3509 Node 0 Normal free:2617828kB min:37120kB low:46400kB high:55680kB active_anon:385888kB inactive_anon:252kB active_file:14260kB inactive_file:34344kB unevictable:0kB writepending:0kB present:4718592kB managed:3593744kB mlocked:0kB kernel_stack:4928kB pagetables:2940kB bounce:0kB free_pcp:888kB local_pcp:148kB free_cma:0kB lowmem_reserve[]: do_group_exit+0x149/0x400 kernel/exit.c:968 0 0 get_signal+0x73a/0x16d0 kernel/signal.c:2469 0 0 Node 0 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809 DMA: 1*4kB (U) 0*8kB 0*16kB exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162 1*32kB prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:265 [inline] do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292 (U) 2*64kB (U) 1*128kB entry_SYSCALL_64_after_hwframe+0x42/0xb7 (U) RIP: 0033:0x453e69 RSP: 002b:00007f6790fa5ce8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000072bf80 RCX: 0000000000453e69 1*256kB RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000072bf80 RBP: 000000000072bf80 R08: 0000000000000000 R09: 000000000072bf58 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000a3e8ef R14: 00007f6790fa69c0 R15: 0000000000000001 (U) Allocated by task 9817: 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 0*512kB kmem_cache_alloc_trace+0x136/0x740 mm/slab.c:3607 kmalloc include/linux/slab.h:512 [inline] kzalloc include/linux/slab.h:701 [inline] ucma_alloc_ctx+0xce/0x610 drivers/infiniband/core/ucma.c:188 ucma_create_id+0x205/0x620 drivers/infiniband/core/ucma.c:473 1*1024kB ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1633 __vfs_write+0xef/0x970 fs/read_write.c:480 vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 (U) do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 1*2048kB Freed by task 9817: 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 (M) __cache_free mm/slab.c:3485 [inline] kfree+0xd9/0x260 mm/slab.c:3800 ucma_create_id+0x45b/0x620 drivers/infiniband/core/ucma.c:500 ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1633 __vfs_write+0xef/0x970 fs/read_write.c:480 3*4096kB vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 (M) The buggy address belongs to the object at ffff8801d1cbb800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 128 bytes inside of 256-byte region [ffff8801d1cbb800, ffff8801d1cbb900) The buggy address belongs to the page: = 15908kB page:ffffea0007472ec0 count:1 mapcount:0 mapping:ffff8801d1cbb080 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801d1cbb080 0000000000000000 000000010000000c Node 0 raw: ffffea00074bd0a0 ffffea00073f62e0 ffff8801dac007c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: DMA32: ffff8801d1cbb780: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d1cbb800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d1cbb880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ 3*4kB ffff8801d1cbb900: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8801d1cbb980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== (M)