================================================================== BUG: KASAN: wild-memory-access in knode_dead lib/klist.c:55 [inline] BUG: KASAN: wild-memory-access in klist_next+0x11c/0x312 lib/klist.c:393 Read of size 8 at addr 00fd77b3050cb77b by task syz-executor.1/2778 CPU: 0 PID: 2778 Comm: syz-executor.1 Not tainted 5.17.0-rc1-syzkaller-00002-g0966d385830d #0 Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:113 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:119 [] __dump_stack lib/dump_stack.c:88 [inline] [] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:106 [] __kasan_report mm/kasan/report.c:446 [inline] [] kasan_report+0x1de/0x1e0 mm/kasan/report.c:459 [] check_region_inline mm/kasan/generic.c:183 [inline] [] __asan_load8+0x6e/0x96 mm/kasan/generic.c:256 [] knode_dead lib/klist.c:55 [inline] [] klist_next+0x11c/0x312 lib/klist.c:393 [] class_dev_iter_next drivers/base/class.c:311 [inline] [] class_find_device+0x144/0x21a drivers/base/class.c:415 [] class_find_device_by_devt include/linux/device/class.h:167 [inline] [] tty_get_device drivers/tty/tty_io.c:3074 [inline] [] alloc_tty_struct+0x4a8/0x540 drivers/tty/tty_io.c:3122 [] tty_init_dev.part.0+0x26/0x362 drivers/tty/tty_io.c:1412 [] tty_init_dev include/linux/err.h:36 [inline] [] tty_open_by_driver drivers/tty/tty_io.c:2086 [inline] [] tty_open+0x8b0/0xb12 drivers/tty/tty_io.c:2133 [] chrdev_open+0x1d4/0x478 fs/char_dev.c:414 [] do_dentry_open+0x2a4/0x7d4 fs/open.c:824 [] vfs_open+0x52/0x5e fs/open.c:959 [] do_open fs/namei.c:3476 [inline] [] path_openat+0x12b6/0x189e fs/namei.c:3609 [] do_filp_open+0x10e/0x22a fs/namei.c:3636 [] do_sys_openat2+0x174/0x31e fs/open.c:1214 [] do_sys_open fs/open.c:1230 [inline] [] __do_sys_openat fs/open.c:1246 [inline] [] sys_openat+0xdc/0x164 fs/open.c:1241 [] ret_from_syscall+0x0/0x2 ================================================================== Unable to handle kernel paging request at virtual address 00fd77b3050cb77b Oops [#1] Modules linked in: CPU: 0 PID: 2778 Comm: syz-executor.1 Tainted: G B 5.17.0-rc1-syzkaller-00002-g0966d385830d #0 Hardware name: riscv-virtio,qemu (DT) epc : knode_dead lib/klist.c:55 [inline] epc : klist_next+0x11c/0x312 lib/klist.c:393 ra : knode_dead lib/klist.c:55 [inline] ra : klist_next+0x11c/0x312 lib/klist.c:393 epc : ffffffff80c1a8fe ra : ffffffff80c1a8fe sp : ffffaf80106e7430 gp : ffffffff85863ac0 tp : ffffaf800f0e3080 t0 : ffffffff86bcb657 t1 : fffff5ef0b53910c t2 : 0000000000000000 s0 : ffffaf80106e7490 s1 : ffffaf80106e74c0 a0 : 0000000000000001 a1 : 0000000000000003 a2 : 1ffff5f001e1c611 a3 : ffffffff831afd3a a4 : 0000000000000000 a5 : ffffaf800f0e4080 a6 : 0000000000f00000 a7 : ffffaf805a9c8863 s2 : 00fd77b3050cb77b s3 : 0000000000000001 s4 : ffffaf800c3938c0 s5 : ffffaf80106e74c8 s6 : 0000000000000022 s7 : 0000000000000000 s8 : ffffaf80095e1180 s9 : ffffaf800f254010 s10: ffffaf800f2543f8 s11: ffffaf800f077ba8 t3 : 0000000061736944 t4 : fffff5ef0b53910c t5 : fffff5ef0b53910d t6 : ffffaf80106e6e78 status: 0000000000000100 badaddr: 00fd77b3050cb77b cause: 000000000000000d [] class_dev_iter_next drivers/base/class.c:311 [inline] [] class_find_device+0x144/0x21a drivers/base/class.c:415 [] class_find_device_by_devt include/linux/device/class.h:167 [inline] [] tty_get_device drivers/tty/tty_io.c:3074 [inline] [] alloc_tty_struct+0x4a8/0x540 drivers/tty/tty_io.c:3122 [] tty_init_dev.part.0+0x26/0x362 drivers/tty/tty_io.c:1412 [] tty_init_dev include/linux/err.h:36 [inline] [] tty_open_by_driver drivers/tty/tty_io.c:2086 [inline] [] tty_open+0x8b0/0xb12 drivers/tty/tty_io.c:2133 [] chrdev_open+0x1d4/0x478 fs/char_dev.c:414 [] do_dentry_open+0x2a4/0x7d4 fs/open.c:824 [] vfs_open+0x52/0x5e fs/open.c:959 [] do_open fs/namei.c:3476 [inline] [] path_openat+0x12b6/0x189e fs/namei.c:3609 [] do_filp_open+0x10e/0x22a fs/namei.c:3636 [] do_sys_openat2+0x174/0x31e fs/open.c:1214 [] do_sys_open fs/open.c:1230 [inline] [] __do_sys_openat fs/open.c:1246 [inline] [] sys_openat+0xdc/0x164 fs/open.c:1241 [] ret_from_syscall+0x0/0x2 ---[ end trace 0000000000000000 ]---