================================================================== BUG: KASAN: slab-use-after-free in __stop_tty drivers/tty/tty_io.c:742 [inline] BUG: KASAN: slab-use-after-free in stop_tty+0xec/0x110 drivers/tty/tty_io.c:766 Read of size 1 at addr ffff8880395d5480 by task syz.0.4246/21083 CPU: 0 UID: 0 PID: 21083 Comm: syz.0.4246 Tainted: G L syzkaller #0 PREEMPT_{RT,(full)} Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 __stop_tty drivers/tty/tty_io.c:742 [inline] stop_tty+0xec/0x110 drivers/tty/tty_io.c:766 kbd_keycode drivers/tty/vt/keyboard.c:1571 [inline] kbd_event+0x2e95/0x41f0 drivers/tty/vt/keyboard.c:1589 input_handle_events_default+0xd4/0x1a0 drivers/input/input.c:2561 input_pass_values+0x288/0x890 drivers/input/input.c:128 input_event_dispose+0x330/0x6b0 drivers/input/input.c:342 input_inject_event+0x1fa/0x310 drivers/input/input.c:424 evdev_write+0x328/0x4c0 drivers/input/evdev.c:528 vfs_write+0x29f/0xbb0 fs/read_write.c:685 ksys_write+0x156/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x17b/0x530 arch/x86/entry/syscall_64.c:85 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f473059de99 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f472e7f6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f4730825fa0 RCX: 00007f473059de99 RDX: 0000000000002250 RSI: 0000200000000040 RDI: 0000000000000006 RBP: 00007f4730633eaf R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4730826038 R14: 00007f4730825fa0 R15: 00007ffeb6302f78 Allocated by task 21090: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x3cd/0x670 mm/slub.c:5486 _kmalloc_noprof include/linux/slab.h:969 [inline] _kzalloc_noprof include/linux/slab.h:1290 [inline] alloc_tty_struct+0xa6/0x7a0 drivers/tty/tty_io.c:3102 tty_init_dev+0x59/0x4d0 drivers/tty/tty_io.c:1400 tty_open_by_driver drivers/tty/tty_io.c:2073 [inline] tty_open+0x7e5/0xcd0 drivers/tty/tty_io.c:2120 chrdev_open+0x4dc/0x600 fs/char_dev.c:411 do_dentry_open+0x849/0x1420 fs/open.c:947 vfs_open+0x3b/0x350 fs/open.c:1052 do_open fs/namei.c:4694 [inline] path_openat+0x2e64/0x3850 fs/namei.c:4857 do_file_open+0x23e/0x4a0 fs/namei.c:4886 do_sys_openat2+0x115/0x200 fs/open.c:1368 do_sys_open fs/open.c:1374 [inline] __do_sys_openat fs/open.c:1390 [inline] __se_sys_openat fs/open.c:1385 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1385 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x17b/0x530 arch/x86/entry/syscall_64.c:85 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 19450: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2706 [inline] slab_free mm/slub.c:6388 [inline] kfree+0x1c5/0x6c0 mm/slub.c:6703 process_one_work+0xaaf/0x1480 kernel/workqueue.c:3379 process_scheduled_works kernel/workqueue.c:3462 [inline] worker_thread+0xb05/0x10d0 kernel/workqueue.c:3543 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556 insert_work+0x3d/0x330 kernel/workqueue.c:2260 __queue_work+0xd4a/0x1120 kernel/workqueue.c:2436 queue_work_on+0x106/0x1d0 kernel/workqueue.c:2489 tty_release_struct+0xb8/0xd0 drivers/tty/tty_io.c:1692 tty_release+0xc6b/0x1680 drivers/tty/tty_io.c:1852 __fput+0x42a/0xa80 fs/file_table.c:512 task_work_run+0x1d9/0x270 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x1fa/0x730 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:339 [inline] do_syscall_64+0x33d/0x530 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880395d5000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 1152 bytes inside of freed 2048-byte region [ffff8880395d5000, ffff8880395d5800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x395d0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8880352dbe81 flags: 0x80000000000040(head|node=0|zone=1) page_type: f5(slab) raw: 0080000000000040 ffff88813fe543c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800080008 00000000f5000000 ffff8880352dbe81 head: 0080000000000040 ffff88813fe543c0 dead000000000100 dead000000000122 head: 0000000000000000 0000000800080008 00000000f5000000 ffff8880352dbe81 head: 0080000000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5587, tgid 5587 (syz-executor), ts 82960607583 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x264c/0x26c0 mm/page_alloc.c:3955 __alloc_frozen_pages_noprof+0x222/0x5b0 mm/page_alloc.c:5394 alloc_slab_page mm/slub.c:3295 [inline] allocate_slab+0x7c/0x5e0 mm/slub.c:3410 new_slab mm/slub.c:3456 [inline] refill_objects+0x2d8/0x350 mm/slub.c:7321 refill_sheaf mm/slub.c:2833 [inline] __pcs_replace_empty_main+0x330/0x690 mm/slub.c:4699 alloc_from_pcs mm/slub.c:4775 [inline] slab_alloc_node mm/slub.c:4909 [inline] __do_kmalloc_node mm/slub.c:5338 [inline] __kmalloc_node_track_caller_noprof+0x616/0x7b0 mm/slub.c:5468 kmemdup_noprof+0x2b/0x70 mm/util.c:138 kmemdup_noprof include/linux/fortify-string.h:715 [inline] neigh_sysctl_register+0xae/0xa90 net/core/neighbour.c:3854 devinet_sysctl_register+0xad/0x200 net/ipv4/devinet.c:2783 inetdev_init+0x2ab/0x4e0 net/ipv4/devinet.c:291 inetdev_event+0x307/0x15e0 net/ipv4/devinet.c:1590 notifier_call_chain+0x1a5/0x3d0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2292 [inline] call_netdevice_notifiers net/core/dev.c:2306 [inline] register_netdevice+0x18c0/0x1ed0 net/core/dev.c:11490 __ip_tunnel_create+0x3e8/0x550 net/ipv4/ip_tunnel.c:268 ip_tunnel_init_net+0x2e5/0x820 net/ipv4/ip_tunnel.c:1150 page last free pid 5625 tgid 5625 ts 82373312021 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x1185/0x1270 mm/page_alloc.c:2962 __slab_free+0x252/0x2a0 mm/slub.c:5738 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4608 [inline] slab_alloc_node mm/slub.c:4921 [inline] __kmalloc_cache_noprof+0x34b/0x670 mm/slub.c:5482 _kmalloc_noprof include/linux/slab.h:969 [inline] _kzalloc_noprof include/linux/slab.h:1290 [inline] tomoyo_dump_page+0xe9/0x520 security/tomoyo/domain.c:916 tomoyo_scan_bprm security/tomoyo/condition.c:130 [inline] tomoyo_condition+0x25f8/0x3330 security/tomoyo/condition.c:1120 tomoyo_check_acl+0x182/0x400 security/tomoyo/domain.c:177 tomoyo_execute_permission+0x123/0x400 security/tomoyo/file.c:620 tomoyo_find_next_domain+0x486/0x1a90 security/tomoyo/domain.c:763 tomoyo_bprm_check_security+0x11c/0x180 security/tomoyo/tomoyo.c:102 security_bprm_check+0x78/0x200 security/security.c:820 search_binary_handler fs/exec.c:1684 [inline] exec_binprm fs/exec.c:1726 [inline] bprm_execve+0x877/0x14b0 fs/exec.c:1778 kernel_execve+0x8c3/0x9c0 fs/exec.c:1922 call_usermodehelper_exec_async+0x212/0x360 kernel/umh.c:107 Memory state around the buggy address: ffff8880395d5380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880395d5400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880395d5480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880395d5500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880395d5580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================