BUG: KASAN: use-after-free in do_get_mempolicy+0xb41/0xba0 mm/mempolicy.c:938 at addr ffff8801d867e0a6 Read of size 2 by task syz-executor7/30145 CPU: 1 PID: 30145 Comm: syz-executor7 Not tainted 4.9.39-g5b07c2d #4 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801c7f3fcf8 ffffffff81eacd59 ffff8801dac0ec80 ffff8801d867e0a0 ffff8801d867e0b8 ffffed003b0cfc14 ffff8801d867e0a6 ffff8801c7f3fd20 ffffffff81546bfc ffffed003b0cfc14 ffff8801dac0ec80 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:160 [] print_address_description mm/kasan/report.c:198 [inline] [] kasan_report_error mm/kasan/report.c:287 [inline] [] kasan_report.part.1+0x20d/0x4e0 mm/kasan/report.c:309 [] kasan_report mm/kasan/report.c:328 [inline] [] __asan_report_load2_noabort+0x29/0x30 mm/kasan/report.c:328 [] do_get_mempolicy+0xb41/0xba0 mm/mempolicy.c:938 [] SYSC_get_mempolicy mm/mempolicy.c:1479 [inline] [] SyS_get_mempolicy+0xc3/0x190 mm/mempolicy.c:1468 [] entry_SYSCALL_64_fastpath+0x23/0xc6 Object at ffff8801d867e0a0, in cache numa_policy size: 24 Allocated: PID = 30145 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:598 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:537 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] slab_alloc mm/slub.c:2723 [inline] kmem_cache_alloc+0xc9/0x2a0 mm/slub.c:2728 __mpol_dup+0x79/0x3c0 mm/mempolicy.c:2104 mpol_dup include/linux/mempolicy.h:89 [inline] vma_replace_policy mm/mempolicy.c:703 [inline] mbind_range mm/mempolicy.c:776 [inline] do_mbind+0x71e/0xb30 mm/mempolicy.c:1240 SYSC_mbind mm/mempolicy.c:1349 [inline] SyS_mbind+0x13b/0x150 mm/mempolicy.c:1331 entry_SYSCALL_64_fastpath+0x23/0xc6 Freed: PID = 30128 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:571 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xb2/0x2e0 mm/slub.c:2980 __mpol_put+0x26/0x30 mm/mempolicy.c:299 mpol_put include/linux/mempolicy.h:67 [inline] remove_vma+0x12b/0x1a0 mm/mmap.c:174 remove_vma_list mm/mmap.c:2482 [inline] do_munmap+0x7ff/0xeb0 mm/mmap.c:2705 mmap_region+0x14d/0xfe0 mm/mmap.c:1635 do_mmap+0x595/0xbe0 mm/mmap.c:1473 do_mmap_pgoff include/linux/mm.h:2014 [inline] vm_mmap_pgoff+0x158/0x1a0 mm/util.c:305 SYSC_mmap_pgoff mm/mmap.c:1523 [inline] SyS_mmap_pgoff+0x1fc/0x580 mm/mmap.c:1481 SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86 entry_SYSCALL_64_fastpath+0x23/0xc6 Memory state around the buggy address: ffff8801d867df80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8801d867e000: fb fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb >ffff8801d867e080: fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb ^ ffff8801d867e100: fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb ffff8801d867e180: fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb fc ================================================================== ================================================================== BUG: KASAN: use-after-free in do_get_mempolicy+0xb23/0xba0 mm/mempolicy.c:938 at addr ffff8801d867e0b0 Read of size 8 by task syz-executor7/30145 CPU: 1 PID: 30145 Comm: syz-executor7 Tainted: G B 4.9.39-g5b07c2d #4 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801c7f3fcf8 ffffffff81eacd59 ffff8801dac0ec80 ffff8801d867e0a0 ffff8801d867e0b8 ffffed003b0cfc16 ffff8801d867e0b0 ffff8801c7f3fd20 ffffffff81546bfc ffffed003b0cfc16 ffff8801dac0ec80 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:160 [] print_address_description mm/kasan/report.c:198 [inline] [] kasan_report_error mm/kasan/report.c:287 [inline] [] kasan_report.part.1+0x20d/0x4e0 mm/kasan/report.c:309 [] kasan_report mm/kasan/report.c:330 [inline] [] __asan_report_load8_noabort+0x29/0x30 mm/kasan/report.c:330 [] do_get_mempolicy+0xb23/0xba0 mm/mempolicy.c:938 [] SYSC_get_mempolicy mm/mempolicy.c:1479 [inline] [] SyS_get_mempolicy+0xc3/0x190 mm/mempolicy.c:1468 [] entry_SYSCALL_64_fastpath+0x23/0xc6 Object at ffff8801d867e0a0, in cache numa_policy size: 24 Allocated: PID = 30145 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:598 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:537 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] slab_alloc mm/slub.c:2723 [inline] kmem_cache_alloc+0xc9/0x2a0 mm/slub.c:2728 __mpol_dup+0x79/0x3c0 mm/mempolicy.c:2104 mpol_dup include/linux/mempolicy.h:89 [inline] vma_replace_policy mm/mempolicy.c:703 [inline] mbind_range mm/mempolicy.c:776 [inline] do_mbind+0x71e/0xb30 mm/mempolicy.c:1240 SYSC_mbind mm/mempolicy.c:1349 [inline] SyS_mbind+0x13b/0x150 mm/mempolicy.c:1331 entry_SYSCALL_64_fastpath+0x23/0xc6 Freed: PID = 30128 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:571 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xb2/0x2e0 mm/slub.c:2980 __mpol_put+0x26/0x30 mm/mempolicy.c:299 mpol_put include/linux/mempolicy.h:67 [inline] remove_vma+0x12b/0x1a0 mm/mmap.c:174 remove_vma_list mm/mmap.c:2482 [inline] do_munmap+0x7ff/0xeb0 mm/mmap.c:2705 mmap_region+0x14d/0xfe0 mm/mmap.c:1635 do_mmap+0x595/0xbe0 mm/mmap.c:1473 do_mmap_pgoff include/linux/mm.h:2014 [inline] vm_mmap_pgoff+0x158/0x1a0 mm/util.c:305 SYSC_mmap_pgoff mm/mmap.c:1523 [inline] SyS_mmap_pgoff+0x1fc/0x580 mm/mmap.c:1481 SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86 entry_SYSCALL_64_fastpath+0x23/0xc6 Memory state around the buggy address: ffff8801d867df80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8801d867e000: fb fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb >ffff8801d867e080: fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb ^ ffff8801d867e100: fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb ffff8801d867e180: fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb fc ================================================================== ================================================================== BUG: KASAN: use-after-free in mpol_needs_cond_ref include/linux/mempolicy.h:76 [inline] at addr ffff8801d867e0a6 BUG: KASAN: use-after-free in mpol_cond_put include/linux/mempolicy.h:81 [inline] at addr ffff8801d867e0a6 BUG: KASAN: use-after-free in do_get_mempolicy+0xaee/0xba0 mm/mempolicy.c:947 at addr ffff8801d867e0a6 Read of size 2 by task syz-executor7/30145 CPU: 1 PID: 30145 Comm: syz-executor7 Tainted: G B 4.9.39-g5b07c2d #4 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801c7f3fcf8 ffffffff81eacd59 ffff8801dac0ec80 ffff8801d867e0a0 ffff8801d867e0b8 ffffed003b0cfc14 ffff8801d867e0a6 ffff8801c7f3fd20 ffffffff81546bfc ffffed003b0cfc14 ffff8801dac0ec80 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:160 [] print_address_description mm/kasan/report.c:198 [inline] [] kasan_report_error mm/kasan/report.c:287 [inline] [] kasan_report.part.1+0x20d/0x4e0 mm/kasan/report.c:309 [] kasan_report mm/kasan/report.c:328 [inline] [] __asan_report_load2_noabort+0x29/0x30 mm/kasan/report.c:328 [] mpol_needs_cond_ref include/linux/mempolicy.h:76 [inline] [] mpol_cond_put include/linux/mempolicy.h:81 [inline] [] do_get_mempolicy+0xaee/0xba0 mm/mempolicy.c:947 [] SYSC_get_mempolicy mm/mempolicy.c:1479 [inline] [] SyS_get_mempolicy+0xc3/0x190 mm/mempolicy.c:1468 [] entry_SYSCALL_64_fastpath+0x23/0xc6 Object at ffff8801d867e0a0, in cache numa_policy size: 24 Allocated: PID = 30145 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:598 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:537 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] slab_alloc mm/slub.c:2723 [inline] kmem_cache_alloc+0xc9/0x2a0 mm/slub.c:2728 __mpol_dup+0x79/0x3c0 mm/mempolicy.c:2104 mpol_dup include/linux/mempolicy.h:89 [inline] vma_replace_policy mm/mempolicy.c:703 [inline] mbind_range mm/mempolicy.c:776 [inline] do_mbind+0x71e/0xb30 mm/mempolicy.c:1240 SYSC_mbind mm/mempolicy.c:1349 [inline] SyS_mbind+0x13b/0x150 mm/mempolicy.c:1331 entry_SYSCALL_64_fastpath+0x23/0xc6 Freed: PID = 30128 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:571 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xb2/0x2e0 mm/slub.c:2980 __mpol_put+0x26/0x30 mm/mempolicy.c:299 mpol_put include/linux/mempolicy.h:67 [inline] remove_vma+0x12b/0x1a0 mm/mmap.c:174 remove_vma_list mm/mmap.c:2482 [inline] do_munmap+0x7ff/0xeb0 mm/mmap.c:2705 mmap_region+0x14d/0xfe0 mm/mmap.c:1635 do_mmap+0x595/0xbe0 mm/mmap.c:1473 do_mmap_pgoff include/linux/mm.h:2014 [inline] vm_mmap_pgoff+0x158/0x1a0 mm/util.c:305 SYSC_mmap_pgoff mm/mmap.c:1523 [inline] SyS_mmap_pgoff+0x1fc/0x580 mm/mmap.c:1481 SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86 entry_SYSCALL_64_fastpath+0x23/0xc6 Memory state around the buggy address: ffff8801d867df80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8801d867e000: fb fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb >ffff8801d867e080: fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb ^ ffff8801d867e100: fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb ffff8801d867e180: fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb fc ==================================================================