================================================================== BUG: KASAN: slab-use-after-free in update_tty_status drivers/net/caif/caif_serial.c:90 [inline] BUG: KASAN: slab-use-after-free in handle_tx+0x5c2/0x620 drivers/net/caif/caif_serial.c:223 Read of size 1 at addr ffff88802bffe490 by task aoe_tx0/1422 CPU: 0 UID: 0 PID: 1422 Comm: aoe_tx0 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1a0 mm/kasan/report.c:595 update_tty_status drivers/net/caif/caif_serial.c:90 [inline] handle_tx+0x5c2/0x620 drivers/net/caif/caif_serial.c:223 __netdev_start_xmit include/linux/netdevice.h:5273 [inline] netdev_start_xmit include/linux/netdevice.h:5282 [inline] xmit_one net/core/dev.c:3866 [inline] dev_hard_start_xmit+0x127/0x6c0 net/core/dev.c:3882 __dev_queue_xmit+0x6dd/0x46f0 net/core/dev.c:4832 dev_queue_xmit include/linux/netdevice.h:3381 [inline] tx+0xc4/0x130 drivers/block/aoe/aoenet.c:62 kthread+0x1d8/0x3c0 drivers/block/aoe/aoecmd.c:1241 kthread+0x370/0x450 kernel/kthread.c:467 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 13525: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:958 [inline] kzalloc_noprof include/linux/slab.h:1200 [inline] alloc_tty_struct+0x96/0x8c0 drivers/tty/tty_io.c:3102 tty_init_dev.part.0+0x20/0x470 drivers/tty/tty_io.c:1400 tty_init_dev include/linux/err.h:78 [inline] tty_open_by_driver drivers/tty/tty_io.c:2073 [inline] tty_open+0xa63/0xfa0 drivers/tty/tty_io.c:2120 chrdev_open+0x234/0x6a0 fs/char_dev.c:411 do_dentry_open+0x6d8/0x1660 fs/open.c:949 vfs_open+0x82/0x3f0 fs/open.c:1081 do_open fs/namei.c:4671 [inline] path_openat+0x208c/0x31a0 fs/namei.c:4830 do_file_open+0x20e/0x430 fs/namei.c:4859 do_sys_openat2+0x10d/0x1e0 fs/open.c:1366 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1383 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6007: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6674 [inline] kfree+0x1c7/0x690 mm/slub.c:6886 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3421 kthread+0x370/0x450 kernel/kthread.c:467 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Last potentially related work creation: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 insert_work+0x36/0x230 kernel/workqueue.c:2180 __queue_work+0x96f/0x10f0 kernel/workqueue.c:2335 queue_work_on+0x180/0x1e0 kernel/workqueue.c:2386 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1557 [inline] tty_kref_put drivers/tty/tty_io.c:1554 [inline] release_tty+0x4f3/0x5f0 drivers/tty/tty_io.c:1593 tty_release_struct+0xb7/0xe0 drivers/tty/tty_io.c:1692 tty_release+0xd7a/0x1300 drivers/tty/tty_io.c:1852 __fput+0x3ff/0xb40 fs/file_table.c:469 task_work_run+0x150/0x240 kernel/task_work.c:233 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x829/0x2a30 kernel/exit.c:971 do_group_exit+0xd5/0x2a0 kernel/exit.c:1112 get_signal+0x1ec7/0x21e0 kernel/signal.c:3034 arch_do_signal_or_restart+0x91/0x7a0 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:64 [inline] exit_to_user_mode_loop+0x86/0x4a0 kernel/entry/common.c:98 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline] do_syscall_64+0x67c/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802bffe000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 1168 bytes inside of freed 2048-byte region [ffff88802bffe000, ffff88802bffe800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2bff8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888025e1b101 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b84c140 ffffea0000c77e00 dead000000000002 raw: 0000000000000000 0000000000080008 00000000f5000000 ffff888025e1b101 head: 00fff00000000040 ffff88801b84c140 ffffea0000c77e00 dead000000000002 head: 0000000000000000 0000000000080008 00000000f5000000 ffff888025e1b101 head: 00fff00000000003 ffffea0000affe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 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 5936, tgid 5936 (syz-executor), ts 61748487268, free_ts 60005615083 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0x111d/0x3140 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c4/0x440 mm/slub.c:3302 ___slab_alloc+0xdb3/0x1cb0 mm/slub.c:4656 __slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_noprof+0x618/0x9c0 mm/slub.c:5669 kmalloc_noprof include/linux/slab.h:962 [inline] kzalloc_noprof include/linux/slab.h:1200 [inline] __register_sysctl_table+0xac/0x1650 fs/proc/proc_sysctl.c:1379 __devinet_sysctl_register+0x1b9/0x360 net/ipv4/devinet.c:2677 devinet_sysctl_register net/ipv4/devinet.c:2717 [inline] devinet_sysctl_register+0x17b/0x210 net/ipv4/devinet.c:2707 inetdev_init+0x2b8/0x570 net/ipv4/devinet.c:291 inetdev_event+0x7fa/0x17f0 net/ipv4/devinet.c:1590 notifier_call_chain+0x99/0x3b0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2243 call_netdevice_notifiers_extack net/core/dev.c:2281 [inline] call_netdevice_notifiers net/core/dev.c:2295 [inline] register_netdevice+0x16b9/0x21d0 net/core/dev.c:11444 page last free pid 5918 tgid 5918 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x822/0x1130 mm/page_alloc.c:2973 __folio_put+0x3b4/0x540 mm/swap.c:112 folio_put include/linux/mm.h:1616 [inline] put_page include/linux/mm.h:1685 [inline] put_netmem+0x294/0x320 net/core/skbuff.c:7420 skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x4b2/0x700 net/core/skbuff.c:1101 skb_release_all net/core/skbuff.c:1182 [inline] __napi_kfree_skb net/core/skbuff.c:1475 [inline] kfree_skb_napi_cache net/core/skbuff.c:7218 [inline] skb_attempt_defer_free+0x1f5/0x700 net/core/skbuff.c:7241 tcp_eat_recv_skb net/ipv4/tcp.c:1583 [inline] tcp_recvmsg_locked+0x1189/0x28e0 net/ipv4/tcp.c:2881 tcp_recvmsg+0x138/0x630 net/ipv4/tcp.c:2927 inet_recvmsg+0x129/0x6a0 net/ipv4/af_inet.c:891 sock_recvmsg_nosec net/socket.c:1078 [inline] sock_recvmsg+0x1b2/0x250 net/socket.c:1100 sock_read_iter+0x2c6/0x3c0 net/socket.c:1170 new_sync_read fs/read_write.c:493 [inline] vfs_read+0x957/0xb30 fs/read_write.c:574 ksys_read+0x1f8/0x250 fs/read_write.c:717 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88802bffe380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802bffe400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802bffe480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802bffe500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802bffe580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================