task:klogd state:R running task stack:0 pid:2979 tgid:2979 ppid:1 flags:0x00000000 Call Trace: [] context_switch kernel/sched/core.c:5369 [inline] [] __schedule+0xdaa/0x393a kernel/sched/core.c:6756 ================================================================== BUG: KASAN: stack-out-of-bounds in walk_stackframe+0x3f0/0x452 arch/riscv/kernel/stacktrace.c:66 Read of size 8 at addr ff20000006f77318 by task ksoftirqd/0/16 CPU: 0 UID: 0 PID: 16 Comm: ksoftirqd/0 Not tainted 6.13.0-rc2-syzkaller-g21f1b85c8912 #0 Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:130 [] show_stack+0x30/0x3c arch/riscv/kernel/stacktrace.c:136 [] __dump_stack lib/dump_stack.c:94 [inline] [] dump_stack_lvl+0x12e/0x1a6 lib/dump_stack.c:120 [] print_address_description mm/kasan/report.c:378 [inline] [] print_report+0x28e/0x5a8 mm/kasan/report.c:489 [] kasan_report+0xec/0x118 mm/kasan/report.c:602 [] __asan_report_load8_noabort+0x12/0x1a mm/kasan/report_generic.c:381 [] walk_stackframe+0x3f0/0x452 arch/riscv/kernel/stacktrace.c:66 [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:130 [] show_stack+0x30/0x3c arch/riscv/kernel/stacktrace.c:136 [] sched_show_task kernel/sched/core.c:7711 [inline] [] sched_show_task+0x42c/0x5dc kernel/sched/core.c:7686 [] show_state_filter+0xcc/0x28e kernel/sched/core.c:7756 [] show_state include/linux/sched/debug.h:21 [inline] [] fn_show_state+0x1a/0x22 drivers/tty/vt/keyboard.c:614 [] k_spec drivers/tty/vt/keyboard.c:667 [inline] [] k_spec+0x102/0x16c drivers/tty/vt/keyboard.c:656 [] kbd_keycode drivers/tty/vt/keyboard.c:1522 [inline] [] kbd_event+0x8ac/0x1056 drivers/tty/vt/keyboard.c:1541 [] input_handle_events_default+0xfe/0x174 drivers/input/input.c:2646 [] input_pass_values+0x6d4/0x7e8 drivers/input/input.c:126 [] input_event_dispose drivers/input/input.c:341 [inline] [] input_handle_event+0x232/0x13e6 drivers/input/input.c:369 [] input_event drivers/input/input.c:398 [inline] [] input_event+0x96/0xc8 drivers/input/input.c:390 [] input_sync include/linux/input.h:464 [inline] [] hidinput_report_event+0xc0/0x114 drivers/hid/hid-input.c:1736 [] hid_report_raw_event+0x26e/0x1146 drivers/hid/hid-core.c:2053 [] __hid_input_report.constprop.0+0x2f6/0x3fa drivers/hid/hid-core.c:2116 [] hid_input_report+0x32/0x44 drivers/hid/hid-core.c:2138 [] hid_irq_in+0x2f6/0x732 drivers/hid/usbhid/hid-core.c:285 [] __usb_hcd_giveback_urb+0x362/0x6f4 drivers/usb/core/hcd.c:1650 [] usb_hcd_giveback_urb+0x364/0x3fe drivers/usb/core/hcd.c:1734 [] dummy_timer+0x134a/0x3458 drivers/usb/gadget/udc/dummy_hcd.c:1993 [] __run_hrtimer kernel/time/hrtimer.c:1739 [inline] [] __hrtimer_run_queues+0x1ac/0xb3e kernel/time/hrtimer.c:1803 [] hrtimer_run_softirq+0x140/0x2e6 kernel/time/hrtimer.c:1820 [] handle_softirqs+0x4b2/0x132e kernel/softirq.c:554 [] __do_softirq kernel/softirq.c:588 [inline] [] invoke_softirq kernel/softirq.c:428 [inline] [] __irq_exit_rcu+0x18c/0x550 kernel/softirq.c:655 [] irq_exit_rcu+0x10/0xf8 kernel/softirq.c:671 [] handle_riscv_irq+0x40/0x4c arch/riscv/kernel/traps.c:378 [] call_on_irq_stack+0x32/0x40 arch/riscv/kernel/entry.S:355 The buggy address belongs to the virtual mapping at [ff20000006f70000, ff20000006f79000) created by: kernel_clone+0x11e/0xc3c kernel/fork.c:2807 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xff60000014be0800 pfn:0x94be0 flags: 0xffe000000000000(node=0|zone=0|lastcpupid=0x7ff) raw: 0ffe000000000000 0000000000000000 dead000000000122 0000000000000000 raw: ff60000014be0800 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 2978, tgid 2978 (start-stop-daem), ts 113440486100, free_ts 113187210100 __set_page_owner+0xa2/0x70c mm/page_owner.c:320 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xf0/0x1e8 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xdb2/0x2c12 mm/page_alloc.c:3474 __alloc_pages_noprof+0x1e8/0x1fc0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0xf8/0x488 mm/mempolicy.c:2269 alloc_pages_noprof+0x174/0x2f0 mm/mempolicy.c:2348 vm_area_alloc_pages mm/vmalloc.c:3589 [inline] __vmalloc_area_node mm/vmalloc.c:3667 [inline] __vmalloc_node_range_noprof+0x642/0x120c mm/vmalloc.c:3844 alloc_thread_stack_node kernel/fork.c:314 [inline] dup_task_struct kernel/fork.c:1121 [inline] copy_process+0x2c04/0x6c90 kernel/fork.c:2225 kernel_clone+0x11e/0xc3c kernel/fork.c:2807 __do_sys_clone+0xe4/0x118 kernel/fork.c:2950 __se_sys_clone kernel/fork.c:2918 [inline] __riscv_sys_clone+0xa0/0x10e kernel/fork.c:2918 syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:90 do_trap_ecall_u+0x1aa/0x216 arch/riscv/kernel/traps.c:331 _new_vmalloc_restore_context_a0+0xc2/0xce page last free pid 2977 tgid 2977 stack trace: __reset_page_owner+0x8c/0x400 mm/page_owner.c:297 reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x61e/0x11d6 mm/page_alloc.c:2657 __free_pages+0x13a/0x1ba mm/page_alloc.c:4838 __free_slab+0xd0/0x176 mm/slub.c:2644 free_slab+0x38/0x1ae mm/slub.c:2667 discard_slab mm/slub.c:2673 [inline] __put_partials+0x174/0x1de mm/slub.c:3142 put_cpu_partial+0x17c/0x296 mm/slub.c:3217 __slab_free+0x112/0x3f6 mm/slub.c:4468 do_slab_free mm/slub.c:4550 [inline] ___cache_free+0x1a4/0x1de mm/slub.c:4656 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x76/0x16c mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x158/0x1ba mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x5c/0x82 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4104 [inline] slab_alloc_node mm/slub.c:4153 [inline] __do_kmalloc_node mm/slub.c:4282 [inline] __kmalloc_noprof+0x216/0x5ba mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:905 [inline] tomoyo_add_entry security/tomoyo/common.c:2023 [inline] tomoyo_supervisor+0xe4a/0x1092 security/tomoyo/common.c:2095 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x23e/0x370 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x3a2/0x3d6 security/tomoyo/file.c:777 Memory state around the buggy address: ff20000006f77200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff20000006f77280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ff20000006f77300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ff20000006f77380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff20000006f77400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================