ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 ================================================================== BUG: KASAN: slab-use-after-free in pty_write_room+0x89/0xb0 drivers/tty/pty.c:131 Read of size 8 at addr ffff88803381d018 by task aoe_tx0/1311 CPU: 0 UID: 0 PID: 1311 Comm: aoe_tx0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 pty_write_room+0x89/0xb0 drivers/tty/pty.c:131 handle_tx+0x163/0x610 drivers/net/caif/caif_serial.c:212 __netdev_start_xmit include/linux/netdevice.h:5275 [inline] netdev_start_xmit include/linux/netdevice.h:5284 [inline] xmit_one net/core/dev.c:3864 [inline] dev_hard_start_xmit+0x2cd/0x7f0 net/core/dev.c:3880 __dev_queue_xmit+0x168f/0x3850 net/core/dev.c:4829 dev_queue_xmit include/linux/netdevice.h:3384 [inline] tx+0x6b/0x190 drivers/block/aoe/aoenet.c:62 kthread+0x1e0/0x3f0 drivers/block/aoe/aoecmd.c:1241 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5311: 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+0x31c/0x660 mm/slub.c:5297 kmalloc_noprof include/linux/slab.h:962 [inline] kzalloc_noprof include/linux/slab.h:1204 [inline] alloc_tty_struct+0xa6/0x7a0 drivers/tty/tty_io.c:3102 pty_common_install+0x17d/0x760 drivers/tty/pty.c:375 tty_driver_install_tty drivers/tty/tty_io.c:1295 [inline] tty_init_dev+0xd7/0x4d0 drivers/tty/tty_io.c:1407 ptmx_open+0x117/0x340 drivers/tty/pty.c:799 chrdev_open+0x4cd/0x5e0 fs/char_dev.c:411 do_dentry_open+0x785/0x14e0 fs/open.c:949 vfs_open+0x3b/0x340 fs/open.c:1081 do_open fs/namei.c:4671 [inline] path_openat+0x2e08/0x3860 fs/namei.c:4830 do_file_open+0x23e/0x4a0 fs/namei.c:4859 do_sys_openat2+0x113/0x200 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+0x138/0x170 fs/open.c:1383 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5298: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/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:2670 [inline] slab_free mm/slub.c:6082 [inline] kfree+0x1c1/0x610 mm/slub.c:6399 process_one_work kernel/workqueue.c:3275 [inline] process_scheduled_works+0xaec/0x17a0 kernel/workqueue.c:3358 worker_thread+0xa50/0xfc0 kernel/workqueue.c:3439 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 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:2199 __queue_work+0xccf/0xf90 kernel/workqueue.c:2354 queue_work_on+0x106/0x1d0 kernel/workqueue.c:2405 release_tty+0x4c1/0x570 drivers/tty/tty_io.c:1592 tty_release_struct+0xb8/0xd0 drivers/tty/tty_io.c:1692 tty_release+0xcb0/0x1710 drivers/tty/tty_io.c:1852 __fput+0x44f/0xa70 fs/file_table.c:469 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:67 [inline] exit_to_user_mode_loop+0xed/0x480 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+0x32d/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803381d000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 24 bytes inside of freed 2048-byte region [ffff88803381d000, ffff88803381d800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x33818 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88803946c801 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801a8583c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800080008 00000000f5000000 ffff88803946c801 head: 04fff00000000040 ffff88801a8583c0 dead000000000100 dead000000000122 head: 0000000000000000 0000000800080008 00000000f5000000 ffff88803946c801 head: 04fff00000000003 ffffea0000ce0601 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 1, tgid 1 (swapper/0), ts 15647114748, free_ts 15446853204 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1883 prep_new_page mm/page_alloc.c:1891 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3956 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5244 alloc_slab_page mm/slub.c:3238 [inline] allocate_slab+0x77/0x660 mm/slub.c:3411 new_slab mm/slub.c:3469 [inline] refill_objects+0x331/0x3c0 mm/slub.c:7091 refill_sheaf mm/slub.c:2787 [inline] __pcs_replace_empty_main+0x2b9/0x620 mm/slub.c:4536 alloc_from_pcs mm/slub.c:4639 [inline] slab_alloc_node mm/slub.c:4773 [inline] __do_kmalloc_node mm/slub.c:5176 [inline] __kmalloc_node_track_caller_noprof+0x572/0x7b0 mm/slub.c:5285 kmemdup_noprof+0x2b/0x70 mm/util.c:138 kmemdup_noprof include/linux/fortify-string.h:763 [inline] neigh_sysctl_register+0xae/0xa90 net/core/neighbour.c:3861 devinet_sysctl_register+0xad/0x200 net/ipv4/devinet.c:2714 inetdev_init+0x2a4/0x4e0 net/ipv4/devinet.c:291 inetdev_event+0x30d/0x1610 net/ipv4/devinet.c:1590 notifier_call_chain+0x19d/0x3a0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2280 [inline] call_netdevice_notifiers net/core/dev.c:2294 [inline] register_netdevice+0x173a/0x1cf0 net/core/dev.c:11444 register_netdev+0x40/0x60 net/core/dev.c:11522 e1000_probe+0x1e94/0x2af0 drivers/net/ethernet/intel/e1000e/netdev.c:7694 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1432 [inline] __free_frozen_pages+0xc01/0xd80 mm/page_alloc.c:2972 __slab_free+0x263/0x2b0 mm/slub.c:5490 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/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:4459 [inline] slab_alloc_node mm/slub.c:4788 [inline] __kmalloc_cache_noprof+0x2ba/0x660 mm/slub.c:5292 kmalloc_noprof include/linux/slab.h:962 [inline] kzalloc_noprof include/linux/slab.h:1204 [inline] lookup_or_create_module_kobject+0x75/0x170 kernel/params.c:769 module_add_driver+0x79/0x320 drivers/base/module.c:46 bus_add_driver+0x391/0x670 drivers/base/bus.c:719 driver_register+0x23a/0x320 drivers/base/driver.c:249 e1000_init_module+0x40/0x80 drivers/net/ethernet/intel/e1000/e1000_main.c:224 do_one_initcall+0x250/0x840 init/main.c:1382 do_initcall_level+0x104/0x190 init/main.c:1444 do_initcalls+0x59/0xa0 init/main.c:1460 kernel_init_freeable+0x2a6/0x3e0 init/main.c:1692 kernel_init+0x1d/0x1d0 init/main.c:1582 Memory state around the buggy address: ffff88803381cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803381cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803381d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803381d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803381d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================