================================================================== 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+0x5dc/0x630 drivers/net/caif/caif_serial.c:237 Read of size 1 at addr ffff888026854490 by task aoe_tx0/1356 CPU: 1 PID: 1356 Comm: aoe_tx0 Not tainted 6.9.0-rc1-syzkaller-00274-g486291a0e624 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 update_tty_status drivers/net/caif/caif_serial.c:90 [inline] handle_tx+0x5dc/0x630 drivers/net/caif/caif_serial.c:237 __netdev_start_xmit include/linux/netdevice.h:4903 [inline] netdev_start_xmit include/linux/netdevice.h:4917 [inline] xmit_one net/core/dev.c:3531 [inline] dev_hard_start_xmit+0x143/0x790 net/core/dev.c:3547 __dev_queue_xmit+0x7be/0x3f20 net/core/dev.c:4335 dev_queue_xmit include/linux/netdevice.h:3091 [inline] tx+0xcc/0x190 drivers/block/aoe/aoenet.c:62 kthread+0x1e7/0x3c0 drivers/block/aoe/aoecmd.c:1229 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Allocated by task 15994: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] alloc_tty_struct+0x98/0x8d0 drivers/tty/tty_io.c:3116 tty_init_dev.part.0+0x1e/0x660 drivers/tty/tty_io.c:1415 tty_init_dev include/linux/err.h:61 [inline] tty_open_by_driver drivers/tty/tty_io.c:2088 [inline] tty_open+0xb2b/0x1020 drivers/tty/tty_io.c:2135 chrdev_open+0x26d/0x6f0 fs/char_dev.c:414 do_dentry_open+0x8da/0x18c0 fs/open.c:955 do_open fs/namei.c:3642 [inline] path_openat+0x1dfb/0x2990 fs/namei.c:3799 do_filp_open+0x1dc/0x430 fs/namei.c:3826 do_sys_openat2+0x17a/0x1e0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1432 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x72/0x7a Freed by task 1282: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x129/0x390 mm/slub.c:4390 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 insert_work+0x36/0x230 kernel/workqueue.c:2248 __queue_work+0x944/0x1020 kernel/workqueue.c:2400 queue_work_on+0xf4/0x120 kernel/workqueue.c:2435 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1572 [inline] tty_kref_put drivers/tty/tty_io.c:1569 [inline] release_tty+0x4e1/0x600 drivers/tty/tty_io.c:1608 tty_release_struct+0xb7/0xe0 drivers/tty/tty_io.c:1707 tty_release+0xe33/0x1420 drivers/tty/tty_io.c:1867 __fput+0x270/0xb80 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa7d/0x2c10 kernel/exit.c:878 do_group_exit+0xd3/0x2a0 kernel/exit.c:1027 get_signal+0x2616/0x2710 kernel/signal.c:2911 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x14a/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xe2/0x260 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x72/0x7a The buggy address belongs to the object at ffff888026854000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 1168 bytes inside of freed 2048-byte region [ffff888026854000, ffff888026854800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888026851000 pfn:0x26850 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801fc29a01 flags: 0xfff80000000a40(workingset|slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000a40 ffff888015450140 ffffea00011a3e10 ffffea00011cc410 raw: ffff888026851000 0000000000080007 00000001ffffffff ffff88801fc29a01 head: 00fff80000000a40 ffff888015450140 ffffea00011a3e10 ffffea00011cc410 head: ffff888026851000 0000000000080007 00000001ffffffff ffff88801fc29a01 head: 00fff80000000003 ffffea00009a1401 ffffea00009a1448 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 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 5202, tgid 5202 (syz-executor.2), ts 54760253371, free_ts 54732442802 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc_node_track_caller+0x367/0x470 mm/slub.c:3986 kmemdup+0x29/0x60 mm/util.c:131 kmemdup include/linux/fortify-string.h:738 [inline] neigh_sysctl_register+0xb3/0x660 net/core/neighbour.c:3796 devinet_sysctl_register+0xb6/0x200 net/ipv4/devinet.c:2626 inetdev_init+0x28b/0x580 net/ipv4/devinet.c:286 inetdev_event+0xd23/0x19b0 net/ipv4/devinet.c:1560 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] register_netdevice+0x15f5/0x1ca0 net/core/dev.c:10310 hsr_dev_finalize+0x540/0x7f0 net/hsr/hsr_device.c:594 page last free pid 5202 tgid 5202 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 __put_partials+0x14c/0x170 mm/slub.c:2906 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmalloc_trace+0x147/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] kobject_uevent_env+0x265/0x1820 lib/kobject_uevent.c:525 __kobject_del+0x168/0x1f0 lib/kobject.c:601 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x31c/0x5b0 lib/kobject.c:737 netdev_queue_update_kobjects+0x4a2/0x640 net/core/net-sysfs.c:1854 netif_set_real_num_tx_queues+0x168/0x880 net/core/dev.c:2893 veth_init_queues+0xe1/0x190 drivers/net/veth.c:1754 veth_newlink+0x627/0xa10 drivers/net/veth.c:1877 rtnl_newlink_create net/core/rtnetlink.c:3494 [inline] __rtnl_newlink+0x1197/0x1960 net/core/rtnetlink.c:3714 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3727 Memory state around the buggy address: ffff888026854380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888026854400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888026854480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888026854500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888026854580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================