================================================================== BUG: KASAN: use-after-free in is_idle_task include/linux/sched.h:1575 [inline] BUG: KASAN: use-after-free in wake_up_if_idle+0x49d/0x5f0 kernel/sched/core.c:1822 Read of size 4 at addr ffff88805ba6c0a4 by task syz-executor0/6061 CPU: 0 PID: 6061 Comm: syz-executor0 Not tainted 5.0.0-rc3-next-20190124 #19 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1db/0x2d0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:134 is_idle_task include/linux/sched.h:1575 [inline] wake_up_if_idle+0x49d/0x5f0 kernel/sched/core.c:1822 wake_up_all_idle_cpus+0x6f/0xc0 kernel/smp.c:753 cpuidle_latency_notify+0xe/0x20 drivers/cpuidle/cpuidle.c:695 notifier_call_chain+0x179/0x380 kernel/notifier.c:93 __blocking_notifier_call_chain kernel/notifier.c:317 [inline] __blocking_notifier_call_chain kernel/notifier.c:304 [inline] blocking_notifier_call_chain kernel/notifier.c:328 [inline] blocking_notifier_call_chain+0x147/0x180 kernel/notifier.c:325 pm_qos_update_target+0x46a/0xd40 kernel/power/qos.c:305 pm_qos_remove_request+0x1c5/0x670 kernel/power/qos.c:531 snd_pcm_release_substream.part.0+0x261/0x330 sound/core/pcm_native.c:2387 snd_pcm_release_substream+0x61/0x80 sound/core/pcm_native.c:2375 snd_pcm_oss_release_file.part.0+0x75/0xa0 sound/core/oss/pcm_oss.c:2382 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2377 [inline] snd_pcm_oss_release+0x116/0x290 sound/core/oss/pcm_oss.c:2562 __fput+0x3c5/0xb10 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x1f4/0x2b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x32a/0x3b0 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x696/0x800 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458099 Code: 6d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f1a31bd9c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffea RBX: 0000000000000004 RCX: 0000000000458099 RDX: 0000000000004000 RSI: 0000000020000140 RDI: ffffffffffffff9c RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1a31bda6d4 R13: 00000000004c400b R14: 00000000004d71e0 R15: 00000000ffffffff Allocated by task 6046: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc mm/kasan/common.c:504 [inline] kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:411 kmem_cache_alloc_node+0x144/0x710 mm/slab.c:3633 alloc_task_struct_node kernel/fork.c:157 [inline] dup_task_struct kernel/fork.c:844 [inline] copy_process+0x4088/0x8890 kernel/fork.c:1753 _do_fork+0x1a9/0x1170 kernel/fork.c:2227 __do_sys_clone kernel/fork.c:2334 [inline] __se_sys_clone kernel/fork.c:2328 [inline] __x64_sys_clone+0xbf/0x150 kernel/fork.c:2328 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 29959: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:458 kasan_slab_free+0xe/0x10 mm/kasan/common.c:466 __cache_free mm/slab.c:3487 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3749 free_task_struct kernel/fork.c:162 [inline] free_task+0x170/0x1f0 kernel/fork.c:457 __put_task_struct+0x2e0/0x630 kernel/fork.c:730 put_task_struct include/linux/sched/task.h:98 [inline] finish_task_switch+0x6b1/0xac0 kernel/sched/core.c:2731 context_switch kernel/sched/core.c:2850 [inline] __schedule+0x89f/0x1e60 kernel/sched/core.c:3488 preempt_schedule_common+0x4f/0xe0 kernel/sched/core.c:3612 preempt_schedule+0x4b/0x60 kernel/sched/core.c:3638 ___preempt_schedule+0x16/0x18 __raw_spin_unlock include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock+0x41/0x50 kernel/locking/spinlock.c:176 spin_unlock include/linux/spinlock.h:369 [inline] copy_pte_range mm/memory.c:867 [inline] copy_pmd_range mm/memory.c:907 [inline] copy_pud_range mm/memory.c:941 [inline] copy_p4d_range mm/memory.c:963 [inline] copy_page_range+0x14a6/0x2730 mm/memory.c:1025 dup_mmap kernel/fork.c:585 [inline] dup_mm kernel/fork.c:1320 [inline] copy_mm kernel/fork.c:1375 [inline] copy_process+0x41d5/0x8890 kernel/fork.c:1917 _do_fork+0x1a9/0x1170 kernel/fork.c:2227 __do_sys_clone kernel/fork.c:2334 [inline] __se_sys_clone kernel/fork.c:2328 [inline] __x64_sys_clone+0xbf/0x150 kernel/fork.c:2328 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88805ba6c080 which belongs to the cache task_struct(65:syz3) of size 6080 The buggy address is located 36 bytes inside of 6080-byte region [ffff88805ba6c080, ffff88805ba6d840) The buggy address belongs to the page: page:ffffea00016e9b00 count:1 mapcount:0 mapping:ffff8880a4bfcb40 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00012d4508 ffffea000256a388 ffff8880a4bfcb40 raw: 0000000000000000 ffff88805ba6c080 0000000100000001 ffff88805a928e00 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88805a928e00 Memory state around the buggy address: ffff88805ba6bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805ba6c000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805ba6c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805ba6c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805ba6c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================