================================================================== BUG: KASAN: use-after-free in do_get_mempolicy+0xb41/0xba0 mm/mempolicy.c:938 at addr ffff8801aaef6006 Read of size 2 by task syz-executor2/13722 CPU: 1 PID: 13722 Comm: syz-executor2 Not tainted 4.9.39-g5b07c2d #4 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801d5857cf8 ffffffff81eacd59 ffff8801dac0ec80 ffff8801aaef6000 ffff8801aaef6018 ffffed00355dec00 ffff8801aaef6006 ffff8801d5857d20 ffffffff81546bfc ffffed00355dec00 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 ffff8801aaef6000, in cache numa_policy size: 24 Allocated: PID = 13720 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 = 13706 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: ffff8801aaef5f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8801aaef5f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8801aaef6000: fb fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb ^ ffff8801aaef6080: fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb ffff8801aaef6100: fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb ================================================================== ================================================================== BUG: KASAN: use-after-free in do_get_mempolicy+0xb23/0xba0 mm/mempolicy.c:938 at addr ffff8801aaef6010 Read of size 8 by task syz-executor2/13722 CPU: 1 PID: 13722 Comm: syz-executor2 Tainted: G B 4.9.39-g5b07c2d #4 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801d5857cf8 ffffffff81eacd59 ffff8801dac0ec80 ffff8801aaef6000 ffff8801aaef6018 ffffed00355dec02 ffff8801aaef6010 ffff8801d5857d20 ffffffff81546bfc ffffed00355dec02 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 ffff8801aaef6000, in cache numa_policy size: 24 Allocated: PID = 13720 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 = 13706 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: ffff8801aaef5f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8801aaef5f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8801aaef6000: fb fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb ^ ffff8801aaef6080: fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb ffff8801aaef6100: fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb ================================================================== ================================================================== BUG: KASAN: use-after-free in mpol_needs_cond_ref include/linux/mempolicy.h:76 [inline] at addr ffff8801aaef6006 BUG: KASAN: use-after-free in mpol_cond_put include/linux/mempolicy.h:81 [inline] at addr ffff8801aaef6006 BUG: KASAN: use-after-free in do_get_mempolicy+0xaee/0xba0 mm/mempolicy.c:947 at addr ffff8801aaef6006 Read of size 2 by task syz-executor2/13722 CPU: 1 PID: 13722 Comm: syz-executor2 Tainted: G B 4.9.39-g5b07c2d #4 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801d5857cf8 ffffffff81eacd59 ffff8801dac0ec80 ffff8801aaef6000 ffff8801aaef6018 ffffed00355dec00 ffff8801aaef6006 ffff8801d5857d20 ffffffff81546bfc ffffed00355dec00 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 ffff8801aaef6000, in cache numa_policy size: 24 Allocated: PID = 13720 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 = 13706 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: ffff8801aaef5f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8801aaef5f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8801aaef6000: fb fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb ^ ffff8801aaef6080: fb fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb ffff8801aaef6100: fb fc fc fb fb fb fc fc fb fb fb fc fc fb fb fb ================================================================== netlink: 8 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor7'. nla_parse: 47 callbacks suppressed netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor4'. kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 15850 Comm: syz-executor3 Tainted: G B 4.9.39-g5b07c2d #4 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801d5038000 task.stack: ffff8801d9b28000 RIP: 0010:[] [] virt_to_head_page include/linux/mm.h:555 [inline] RIP: 0010:[] [] qlink_to_cache mm/kasan/quarantine.c:132 [inline] RIP: 0010:[] [] quarantine_reduce+0x101/0x1b0 mm/kasan/quarantine.c:226 RSP: 0018:ffff8801d9b2fbd8 EFLAGS: 00010007 RAX: 03fe0be6c3b61b00 RBX: 0000000000000000 RCX: 0000000001057198 RDX: ff8801b0ed86c8ff RSI: 0000000080000000 RDI: ffffea0000000000 RBP: ffff8801d9b2fc08 R08: 000077ff80000000 R09: 0000000000000282 R10: 00000000095728c8 R11: ffff8801d8612200 R12: 000077ff80000000 R13: fffffffffffffc28 R14: ffffffff8137911e R15: ffff8801d9d74640 FS: 0000000000c7a940(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f74e7e70db8 CR3: 00000001a95f2000 CR4: 00000000001406f0 DR0: 0000000020000000 DR1: 0000000020000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Stack: 0000000000000000 0000000000000000 0000000000000000 ffff8801d96e7880 ffff8801d96e76f8 00000000024080c0 ffff8801d9b2fc48 ffffffff8154618a 0000000000000148 ffff8801d96e7880 ffff8801d9d74640 00000000024080c0 Call Trace: [] kasan_kmalloc+0xca/0xe0 mm/kasan/kasan.c:583 [] 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 [] kmem_cache_zalloc include/linux/slab.h:626 [inline] [] taskstats_tgid_alloc kernel/taskstats.c:568 [inline] [] taskstats_exit+0x63e/0xb50 kernel/taskstats.c:601 [] do_exit+0x374/0x2a50 kernel/exit.c:818 [] do_group_exit+0x108/0x320 kernel/exit.c:937 [] SYSC_exit_group kernel/exit.c:948 [inline] [] SyS_exit_group+0x1d/0x20 kernel/exit.c:946 [] entry_SYSCALL_64_fastpath+0x23/0xc6 Code: c1 e8 02 49 29 c5 49 39 cd 72 44 4c 89 e2 48 89 d0 48 01 f0 0f 82 b5 00 00 00 4d 89 c4 4c 01 e0 48 c1 e8 0c 48 c1 e0 06 48 01 f8 <4c> 8b 60 20 4d 8d 6c 24 ff 41 83 e4 01 4c 8b 22 49 0f 45 c5 48 RIP [] virt_to_head_page include/linux/mm.h:555 [inline] RIP [] qlink_to_cache mm/kasan/quarantine.c:132 [inline] RIP [] quarantine_reduce+0x101/0x1b0 mm/kasan/quarantine.c:226 RSP ---[ end trace 2ef0ca8f0aa0f6cd ]---