==================================================================
BUG: KASAN: slab-use-after-free in skb_update_prio net/core/dev.c:3861 [inline]
BUG: KASAN: slab-use-after-free in __dev_queue_xmit+0x395b/0x3ee0 net/core/dev.c:4278
Read of size 8 at addr ffff888044694ba8 by task aoe_tx0/1240
CPU: 0 PID: 1240 Comm: aoe_tx0 Not tainted 6.8.0-rc6-syzkaller-00194-g17ba56605bfd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
skb_update_prio net/core/dev.c:3861 [inline]
__dev_queue_xmit+0x395b/0x3ee0 net/core/dev.c:4278
dev_queue_xmit include/linux/netdevice.h:3171 [inline]
tx+0x76/0x100 drivers/block/aoe/aoenet.c:62
kthread+0x1ec/0x3c0 drivers/block/aoe/aoecmd.c:1229
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Allocated by task 21258:
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
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:3981 [inline]
__kmalloc_node+0x21b/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
nsim_create+0x96/0x600 drivers/net/netdevsim/netdev.c:385
__nsim_dev_port_add+0x427/0x7e0 drivers/net/netdevsim/dev.c:1390
nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1446 [inline]
nsim_dev_reload_create drivers/net/netdevsim/dev.c:1498 [inline]
nsim_dev_reload_up+0x5b6/0x860 drivers/net/netdevsim/dev.c:985
devlink_reload+0x2e7/0x7c0 net/devlink/dev.c:474
devlink_pernet_pre_exit+0x1a1/0x2b0 net/devlink/core.c:509
ops_pre_exit_list net/core/net_namespace.c:160 [inline]
cleanup_net+0x46f/0xb20 net/core/net_namespace.c:606
process_one_work+0x88c/0x15e0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x12a0 kernel/workqueue.c:2787
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Freed by task 22146:
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:589
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:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x124/0x370 mm/slub.c:4409
kvfree+0x47/0x50 mm/util.c:663
device_release+0xa4/0x240 drivers/base/core.c:2499
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x1fd/0x5b0 lib/kobject.c:737
put_device+0x1f/0x30 drivers/base/core.c:3747
free_netdev+0x408/0x5f0 net/core/dev.c:10976
__nsim_dev_port_del+0x189/0x240 drivers/net/netdevsim/dev.c:1425
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1437 [inline]
nsim_dev_reload_destroy+0x108/0x4d0 drivers/net/netdevsim/dev.c:1658
nsim_drv_remove+0x52/0x1d0 drivers/net/netdevsim/dev.c:1673
device_remove+0xcb/0x170 drivers/base/dd.c:567
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22f/0x420 drivers/base/bus.c:574
device_del+0x39d/0xa60 drivers/base/core.c:3828
device_unregister+0x1d/0xc0 drivers/base/core.c:3869
nsim_bus_dev_del drivers/net/netdevsim/bus.c:317 [inline]
del_device_store+0x346/0x4b0 drivers/net/netdevsim/bus.c:226
bus_attr_store+0x79/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x11a/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x346/0x500 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:2087 [inline]
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0x6e1/0x1110 fs/read_write.c:590
ksys_write+0x12f/0x260 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xd8/0x270 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6f/0x77
The buggy address belongs to the object at ffff888044694000
which belongs to the cache kmalloc-cg-8k of size 8192
The buggy address is located 2984 bytes inside of
freed 8192-byte region [ffff888044694000, ffff888044696000)
The buggy address belongs to the physical page:
page:ffffea000111a400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44690
head:ffffea000111a400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88802e467a01
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888014c4f640 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000020002 00000001ffffffff ffff88802e467a01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5099, tgid 5099 (syz-executor.5), ts 204378922945, free_ts 33032768931
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311
__alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4af/0x19a0 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node+0x361/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
rtnl_create_link+0xc8f/0xfc0 net/core/rtnetlink.c:3382
rtnl_newlink_create net/core/rtnetlink.c:3508 [inline]
__rtnl_newlink+0x10ae/0x1960 net/core/rtnetlink.c:3738
rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3751
rtnetlink_rcv_msg+0x3ca/0xe10 net/core/rtnetlink.c:6617
netlink_rcv_skb+0x16e/0x440 net/netlink/af_netlink.c:2543
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x545/0x820 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8bb/0xd70 net/netlink/af_netlink.c:1908
page last free pid 1 tgid 1 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2346
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486
free_contig_range+0xb6/0x1a0 mm/page_alloc.c:6535
destroy_args+0xa69/0xe40 mm/debug_vm_pgtable.c:1036
debug_vm_pgtable+0x16fe/0x3250 mm/debug_vm_pgtable.c:1416
do_one_initcall+0x11f/0x670 init/main.c:1236
do_initcall_level init/main.c:1298 [inline]
do_initcalls init/main.c:1314 [inline]
do_basic_setup init/main.c:1333 [inline]
kernel_init_freeable+0x68d/0xc10 init/main.c:1551
kernel_init+0x1c/0x2a0 init/main.c:1441
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Memory state around the buggy address:
ffff888044694a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888044694b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888044694b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888044694c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888044694c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
==================================================================
BUG: KASAN: slab-use-after-free in sch_handle_egress net/core/dev.c:4044 [inline]
BUG: KASAN: slab-use-after-free in __dev_queue_xmit+0x3b58/0x3ee0 net/core/dev.c:4293
Read of size 8 at addr ffff888044694098 by task aoe_tx0/1240
CPU: 0 PID: 1240 Comm: aoe_tx0 Tainted: G B 6.8.0-rc6-syzkaller-00194-g17ba56605bfd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
sch_handle_egress net/core/dev.c:4044 [inline]
__dev_queue_xmit+0x3b58/0x3ee0 net/core/dev.c:4293
dev_queue_xmit include/linux/netdevice.h:3171 [inline]
tx+0x76/0x100 drivers/block/aoe/aoenet.c:62
kthread+0x1ec/0x3c0 drivers/block/aoe/aoecmd.c:1229
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Allocated by task 21258:
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
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:3981 [inline]
__kmalloc_node+0x21b/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
nsim_create+0x96/0x600 drivers/net/netdevsim/netdev.c:385
__nsim_dev_port_add+0x427/0x7e0 drivers/net/netdevsim/dev.c:1390
nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1446 [inline]
nsim_dev_reload_create drivers/net/netdevsim/dev.c:1498 [inline]
nsim_dev_reload_up+0x5b6/0x860 drivers/net/netdevsim/dev.c:985
devlink_reload+0x2e7/0x7c0 net/devlink/dev.c:474
devlink_pernet_pre_exit+0x1a1/0x2b0 net/devlink/core.c:509
ops_pre_exit_list net/core/net_namespace.c:160 [inline]
cleanup_net+0x46f/0xb20 net/core/net_namespace.c:606
process_one_work+0x88c/0x15e0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x12a0 kernel/workqueue.c:2787
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Freed by task 22146:
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:589
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:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x124/0x370 mm/slub.c:4409
kvfree+0x47/0x50 mm/util.c:663
device_release+0xa4/0x240 drivers/base/core.c:2499
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x1fd/0x5b0 lib/kobject.c:737
put_device+0x1f/0x30 drivers/base/core.c:3747
free_netdev+0x408/0x5f0 net/core/dev.c:10976
__nsim_dev_port_del+0x189/0x240 drivers/net/netdevsim/dev.c:1425
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1437 [inline]
nsim_dev_reload_destroy+0x108/0x4d0 drivers/net/netdevsim/dev.c:1658
nsim_drv_remove+0x52/0x1d0 drivers/net/netdevsim/dev.c:1673
device_remove+0xcb/0x170 drivers/base/dd.c:567
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22f/0x420 drivers/base/bus.c:574
device_del+0x39d/0xa60 drivers/base/core.c:3828
device_unregister+0x1d/0xc0 drivers/base/core.c:3869
nsim_bus_dev_del drivers/net/netdevsim/bus.c:317 [inline]
del_device_store+0x346/0x4b0 drivers/net/netdevsim/bus.c:226
bus_attr_store+0x79/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x11a/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x346/0x500 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:2087 [inline]
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0x6e1/0x1110 fs/read_write.c:590
ksys_write+0x12f/0x260 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xd8/0x270 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6f/0x77
The buggy address belongs to the object at ffff888044694000
which belongs to the cache kmalloc-cg-8k of size 8192
The buggy address is located 152 bytes inside of
freed 8192-byte region [ffff888044694000, ffff888044696000)
The buggy address belongs to the physical page:
page:ffffea000111a400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44690
head:ffffea000111a400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88802e467a01
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888014c4f640 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000020002 00000001ffffffff ffff88802e467a01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5099, tgid 5099 (syz-executor.5), ts 204378922945, free_ts 33032768931
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311
__alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4af/0x19a0 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node+0x361/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
rtnl_create_link+0xc8f/0xfc0 net/core/rtnetlink.c:3382
rtnl_newlink_create net/core/rtnetlink.c:3508 [inline]
__rtnl_newlink+0x10ae/0x1960 net/core/rtnetlink.c:3738
rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3751
rtnetlink_rcv_msg+0x3ca/0xe10 net/core/rtnetlink.c:6617
netlink_rcv_skb+0x16e/0x440 net/netlink/af_netlink.c:2543
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x545/0x820 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8bb/0xd70 net/netlink/af_netlink.c:1908
page last free pid 1 tgid 1 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2346
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486
free_contig_range+0xb6/0x1a0 mm/page_alloc.c:6535
destroy_args+0xa69/0xe40 mm/debug_vm_pgtable.c:1036
debug_vm_pgtable+0x16fe/0x3250 mm/debug_vm_pgtable.c:1416
do_one_initcall+0x11f/0x670 init/main.c:1236
do_initcall_level init/main.c:1298 [inline]
do_initcalls init/main.c:1314 [inline]
do_basic_setup init/main.c:1333 [inline]
kernel_init_freeable+0x68d/0xc10 init/main.c:1551
kernel_init+0x1c/0x2a0 init/main.c:1441
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Memory state around the buggy address:
ffff888044693f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888044694000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888044694080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888044694100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888044694180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
==================================================================
BUG: KASAN: slab-use-after-free in __dev_queue_xmit+0x3d7a/0x3ee0 net/core/dev.c:4305
Read of size 8 at addr ffff888044694000 by task aoe_tx0/1240
CPU: 0 PID: 1240 Comm: aoe_tx0 Tainted: G B 6.8.0-rc6-syzkaller-00194-g17ba56605bfd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
__dev_queue_xmit+0x3d7a/0x3ee0 net/core/dev.c:4305
dev_queue_xmit include/linux/netdevice.h:3171 [inline]
tx+0x76/0x100 drivers/block/aoe/aoenet.c:62
kthread+0x1ec/0x3c0 drivers/block/aoe/aoecmd.c:1229
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Allocated by task 21258:
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
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:3981 [inline]
__kmalloc_node+0x21b/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
nsim_create+0x96/0x600 drivers/net/netdevsim/netdev.c:385
__nsim_dev_port_add+0x427/0x7e0 drivers/net/netdevsim/dev.c:1390
nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1446 [inline]
nsim_dev_reload_create drivers/net/netdevsim/dev.c:1498 [inline]
nsim_dev_reload_up+0x5b6/0x860 drivers/net/netdevsim/dev.c:985
devlink_reload+0x2e7/0x7c0 net/devlink/dev.c:474
devlink_pernet_pre_exit+0x1a1/0x2b0 net/devlink/core.c:509
ops_pre_exit_list net/core/net_namespace.c:160 [inline]
cleanup_net+0x46f/0xb20 net/core/net_namespace.c:606
process_one_work+0x88c/0x15e0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x12a0 kernel/workqueue.c:2787
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Freed by task 22146:
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:589
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:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x124/0x370 mm/slub.c:4409
kvfree+0x47/0x50 mm/util.c:663
device_release+0xa4/0x240 drivers/base/core.c:2499
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x1fd/0x5b0 lib/kobject.c:737
put_device+0x1f/0x30 drivers/base/core.c:3747
free_netdev+0x408/0x5f0 net/core/dev.c:10976
__nsim_dev_port_del+0x189/0x240 drivers/net/netdevsim/dev.c:1425
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1437 [inline]
nsim_dev_reload_destroy+0x108/0x4d0 drivers/net/netdevsim/dev.c:1658
nsim_drv_remove+0x52/0x1d0 drivers/net/netdevsim/dev.c:1673
device_remove+0xcb/0x170 drivers/base/dd.c:567
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22f/0x420 drivers/base/bus.c:574
device_del+0x39d/0xa60 drivers/base/core.c:3828
device_unregister+0x1d/0xc0 drivers/base/core.c:3869
nsim_bus_dev_del drivers/net/netdevsim/bus.c:317 [inline]
del_device_store+0x346/0x4b0 drivers/net/netdevsim/bus.c:226
bus_attr_store+0x79/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x11a/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x346/0x500 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:2087 [inline]
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0x6e1/0x1110 fs/read_write.c:590
ksys_write+0x12f/0x260 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xd8/0x270 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6f/0x77
The buggy address belongs to the object at ffff888044694000
which belongs to the cache kmalloc-cg-8k of size 8192
The buggy address is located 0 bytes inside of
freed 8192-byte region [ffff888044694000, ffff888044696000)
The buggy address belongs to the physical page:
page:ffffea000111a400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44690
head:ffffea000111a400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88802e467a01
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888014c4f640 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000020002 00000001ffffffff ffff88802e467a01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5099, tgid 5099 (syz-executor.5), ts 204378922945, free_ts 33032768931
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311
__alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4af/0x19a0 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node+0x361/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
rtnl_create_link+0xc8f/0xfc0 net/core/rtnetlink.c:3382
rtnl_newlink_create net/core/rtnetlink.c:3508 [inline]
__rtnl_newlink+0x10ae/0x1960 net/core/rtnetlink.c:3738
rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3751
rtnetlink_rcv_msg+0x3ca/0xe10 net/core/rtnetlink.c:6617
netlink_rcv_skb+0x16e/0x440 net/netlink/af_netlink.c:2543
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x545/0x820 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8bb/0xd70 net/netlink/af_netlink.c:1908
page last free pid 1 tgid 1 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2346
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486
free_contig_range+0xb6/0x1a0 mm/page_alloc.c:6535
destroy_args+0xa69/0xe40 mm/debug_vm_pgtable.c:1036
debug_vm_pgtable+0x16fe/0x3250 mm/debug_vm_pgtable.c:1416
do_one_initcall+0x11f/0x670 init/main.c:1236
do_initcall_level init/main.c:1298 [inline]
do_initcalls init/main.c:1314 [inline]
do_basic_setup init/main.c:1333 [inline]
kernel_init_freeable+0x68d/0xc10 init/main.c:1551
kernel_init+0x1c/0x2a0 init/main.c:1441
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Memory state around the buggy address:
ffff888044693f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888044693f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888044694000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888044694080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888044694100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
==================================================================
BUG: KASAN: slab-use-after-free in netdev_core_pick_tx+0x325/0x370 net/core/dev.c:4223
Read of size 4 at addr ffff888044694028 by task aoe_tx0/1240
CPU: 0 PID: 1240 Comm: aoe_tx0 Tainted: G B 6.8.0-rc6-syzkaller-00194-g17ba56605bfd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
netdev_core_pick_tx+0x325/0x370 net/core/dev.c:4223
__dev_queue_xmit+0x51c/0x3ee0 net/core/dev.c:4311
dev_queue_xmit include/linux/netdevice.h:3171 [inline]
tx+0x76/0x100 drivers/block/aoe/aoenet.c:62
kthread+0x1ec/0x3c0 drivers/block/aoe/aoecmd.c:1229
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Allocated by task 21258:
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
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:3981 [inline]
__kmalloc_node+0x21b/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
nsim_create+0x96/0x600 drivers/net/netdevsim/netdev.c:385
__nsim_dev_port_add+0x427/0x7e0 drivers/net/netdevsim/dev.c:1390
nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1446 [inline]
nsim_dev_reload_create drivers/net/netdevsim/dev.c:1498 [inline]
nsim_dev_reload_up+0x5b6/0x860 drivers/net/netdevsim/dev.c:985
devlink_reload+0x2e7/0x7c0 net/devlink/dev.c:474
devlink_pernet_pre_exit+0x1a1/0x2b0 net/devlink/core.c:509
ops_pre_exit_list net/core/net_namespace.c:160 [inline]
cleanup_net+0x46f/0xb20 net/core/net_namespace.c:606
process_one_work+0x88c/0x15e0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x12a0 kernel/workqueue.c:2787
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Freed by task 22146:
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:589
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:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x124/0x370 mm/slub.c:4409
kvfree+0x47/0x50 mm/util.c:663
device_release+0xa4/0x240 drivers/base/core.c:2499
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x1fd/0x5b0 lib/kobject.c:737
put_device+0x1f/0x30 drivers/base/core.c:3747
free_netdev+0x408/0x5f0 net/core/dev.c:10976
__nsim_dev_port_del+0x189/0x240 drivers/net/netdevsim/dev.c:1425
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1437 [inline]
nsim_dev_reload_destroy+0x108/0x4d0 drivers/net/netdevsim/dev.c:1658
nsim_drv_remove+0x52/0x1d0 drivers/net/netdevsim/dev.c:1673
device_remove+0xcb/0x170 drivers/base/dd.c:567
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22f/0x420 drivers/base/bus.c:574
device_del+0x39d/0xa60 drivers/base/core.c:3828
device_unregister+0x1d/0xc0 drivers/base/core.c:3869
nsim_bus_dev_del drivers/net/netdevsim/bus.c:317 [inline]
del_device_store+0x346/0x4b0 drivers/net/netdevsim/bus.c:226
bus_attr_store+0x79/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x11a/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x346/0x500 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:2087 [inline]
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0x6e1/0x1110 fs/read_write.c:590
ksys_write+0x12f/0x260 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xd8/0x270 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6f/0x77
The buggy address belongs to the object at ffff888044694000
which belongs to the cache kmalloc-cg-8k of size 8192
The buggy address is located 40 bytes inside of
freed 8192-byte region [ffff888044694000, ffff888044696000)
The buggy address belongs to the physical page:
page:ffffea000111a400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44690
head:ffffea000111a400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88802e467a01
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888014c4f640 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000020002 00000001ffffffff ffff88802e467a01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5099, tgid 5099 (syz-executor.5), ts 204378922945, free_ts 33032768931
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311
__alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4af/0x19a0 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node+0x361/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
rtnl_create_link+0xc8f/0xfc0 net/core/rtnetlink.c:3382
rtnl_newlink_create net/core/rtnetlink.c:3508 [inline]
__rtnl_newlink+0x10ae/0x1960 net/core/rtnetlink.c:3738
rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3751
rtnetlink_rcv_msg+0x3ca/0xe10 net/core/rtnetlink.c:6617
netlink_rcv_skb+0x16e/0x440 net/netlink/af_netlink.c:2543
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x545/0x820 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8bb/0xd70 net/netlink/af_netlink.c:1908
page last free pid 1 tgid 1 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2346
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486
free_contig_range+0xb6/0x1a0 mm/page_alloc.c:6535
destroy_args+0xa69/0xe40 mm/debug_vm_pgtable.c:1036
debug_vm_pgtable+0x16fe/0x3250 mm/debug_vm_pgtable.c:1416
do_one_initcall+0x11f/0x670 init/main.c:1236
do_initcall_level init/main.c:1298 [inline]
do_initcalls init/main.c:1314 [inline]
do_basic_setup init/main.c:1333 [inline]
kernel_init_freeable+0x68d/0xc10 init/main.c:1551
kernel_init+0x1c/0x2a0 init/main.c:1441
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Memory state around the buggy address:
ffff888044693f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888044693f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888044694000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888044694080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888044694100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
==================================================================
BUG: KASAN: slab-use-after-free in netdev_core_pick_tx+0x35d/0x370 net/core/dev.c:4224
Read of size 8 at addr ffff888044694008 by task aoe_tx0/1240
CPU: 0 PID: 1240 Comm: aoe_tx0 Tainted: G B 6.8.0-rc6-syzkaller-00194-g17ba56605bfd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
netdev_core_pick_tx+0x35d/0x370 net/core/dev.c:4224
__dev_queue_xmit+0x51c/0x3ee0 net/core/dev.c:4311
dev_queue_xmit include/linux/netdevice.h:3171 [inline]
tx+0x76/0x100 drivers/block/aoe/aoenet.c:62
kthread+0x1ec/0x3c0 drivers/block/aoe/aoecmd.c:1229
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Allocated by task 21258:
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
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:3981 [inline]
__kmalloc_node+0x21b/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
nsim_create+0x96/0x600 drivers/net/netdevsim/netdev.c:385
__nsim_dev_port_add+0x427/0x7e0 drivers/net/netdevsim/dev.c:1390
nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1446 [inline]
nsim_dev_reload_create drivers/net/netdevsim/dev.c:1498 [inline]
nsim_dev_reload_up+0x5b6/0x860 drivers/net/netdevsim/dev.c:985
devlink_reload+0x2e7/0x7c0 net/devlink/dev.c:474
devlink_pernet_pre_exit+0x1a1/0x2b0 net/devlink/core.c:509
ops_pre_exit_list net/core/net_namespace.c:160 [inline]
cleanup_net+0x46f/0xb20 net/core/net_namespace.c:606
process_one_work+0x88c/0x15e0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x12a0 kernel/workqueue.c:2787
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Freed by task 22146:
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:589
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:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x124/0x370 mm/slub.c:4409
kvfree+0x47/0x50 mm/util.c:663
device_release+0xa4/0x240 drivers/base/core.c:2499
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x1fd/0x5b0 lib/kobject.c:737
put_device+0x1f/0x30 drivers/base/core.c:3747
free_netdev+0x408/0x5f0 net/core/dev.c:10976
__nsim_dev_port_del+0x189/0x240 drivers/net/netdevsim/dev.c:1425
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1437 [inline]
nsim_dev_reload_destroy+0x108/0x4d0 drivers/net/netdevsim/dev.c:1658
nsim_drv_remove+0x52/0x1d0 drivers/net/netdevsim/dev.c:1673
device_remove+0xcb/0x170 drivers/base/dd.c:567
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22f/0x420 drivers/base/bus.c:574
device_del+0x39d/0xa60 drivers/base/core.c:3828
device_unregister+0x1d/0xc0 drivers/base/core.c:3869
nsim_bus_dev_del drivers/net/netdevsim/bus.c:317 [inline]
del_device_store+0x346/0x4b0 drivers/net/netdevsim/bus.c:226
bus_attr_store+0x79/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x11a/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x346/0x500 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:2087 [inline]
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0x6e1/0x1110 fs/read_write.c:590
ksys_write+0x12f/0x260 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xd8/0x270 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6f/0x77
The buggy address belongs to the object at ffff888044694000
which belongs to the cache kmalloc-cg-8k of size 8192
The buggy address is located 8 bytes inside of
freed 8192-byte region [ffff888044694000, ffff888044696000)
The buggy address belongs to the physical page:
page:ffffea000111a400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x44690
head:ffffea000111a400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88802e467a01
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888014c4f640 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000020002 00000001ffffffff ffff88802e467a01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5099, tgid 5099 (syz-executor.5), ts 204378922945, free_ts 33032768931
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3311
__alloc_pages+0x22f/0x2440 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4af/0x19a0 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node+0x361/0x470 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kvmalloc_node+0x6f/0x1a0 mm/util.c:617
kvmalloc include/linux/slab.h:728 [inline]
kvzalloc include/linux/slab.h:736 [inline]
alloc_netdev_mqs+0xb3/0x12a0 net/core/dev.c:10826
rtnl_create_link+0xc8f/0xfc0 net/core/rtnetlink.c:3382
rtnl_newlink_create net/core/rtnetlink.c:3508 [inline]
__rtnl_newlink+0x10ae/0x1960 net/core/rtnetlink.c:3738
rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3751
rtnetlink_rcv_msg+0x3ca/0xe10 net/core/rtnetlink.c:6617
netlink_rcv_skb+0x16e/0x440 net/netlink/af_netlink.c:2543
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x545/0x820 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8bb/0xd70 net/netlink/af_netlink.c:1908
page last free pid 1 tgid 1 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2346
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2486
free_contig_range+0xb6/0x1a0 mm/page_alloc.c:6535
destroy_args+0xa69/0xe40 mm/debug_vm_pgtable.c:1036
debug_vm_pgtable+0x16fe/0x3250 mm/debug_vm_pgtable.c:1416
do_one_initcall+0x11f/0x670 init/main.c:1236
do_initcall_level init/main.c:1298 [inline]
do_initcalls init/main.c:1314 [inline]
do_basic_setup init/main.c:1333 [inline]
kernel_init_freeable+0x68d/0xc10 init/main.c:1551
kernel_init+0x1c/0x2a0 init/main.c:1441
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Memory state around the buggy address:
ffff888044693f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888044693f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888044694000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888044694080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888044694100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
general protection fault, probably for non-canonical address 0xe0acfc58c0000ad6: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: maybe wild-memory-access in range [0x056802c6000056b0-0x056802c6000056b7]
CPU: 0 PID: 1240 Comm: aoe_tx0 Tainted: G B 6.8.0-rc6-syzkaller-00194-g17ba56605bfd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
RIP: 0010:netdev_core_pick_tx+0x121/0x370 net/core/dev.c:4226
Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 51 02 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 63 08 49 8d 7c 24 30 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 23 02 00 00 4d 8b 64 24 30 4d 85 e4 0f 84 58 01
RSP: 0018:ffffc90004bafba0 EFLAGS: 00010212
RAX: dffffc0000000000 RBX: ffff888044694000 RCX: ffffffff8150a8cf
RDX: 00ad0058c0000ad6 RSI: ffffffff81e609a7 RDI: 056802c6000056b2
RBP: ffff888022288c80 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: 056802c600005682
R13: 0000000000000000 R14: ffff888022288d20 R15: ffff888044694028
FS: 0000000000000000(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c00ab97000 CR3: 0000000047bb0000 CR4: 0000000000350ef0
Call Trace:
__dev_queue_xmit+0x51c/0x3ee0 net/core/dev.c:4311
dev_queue_xmit include/linux/netdevice.h:3171 [inline]
tx+0x76/0x100 drivers/block/aoe/aoenet.c:62
kthread+0x1ec/0x3c0 drivers/block/aoe/aoecmd.c:1229
kthread+0x2c9/0x3b0 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:243
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:netdev_core_pick_tx+0x121/0x370 net/core/dev.c:4226
Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 51 02 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 63 08 49 8d 7c 24 30 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 23 02 00 00 4d 8b 64 24 30 4d 85 e4 0f 84 58 01
RSP: 0018:ffffc90004bafba0 EFLAGS: 00010212
RAX: dffffc0000000000 RBX: ffff888044694000 RCX: ffffffff8150a8cf
RDX: 00ad0058c0000ad6 RSI: ffffffff81e609a7 RDI: 056802c6000056b2
RBP: ffff888022288c80 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: 056802c600005682
R13: 0000000000000000 R14: ffff888022288d20 R15: ffff888044694028
FS: 0000000000000000(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c00ab97000 CR3: 0000000047bb0000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess):
0: 89 fa mov %edi,%edx
2: 48 c1 ea 03 shr $0x3,%rdx
6: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
a: 0f 85 51 02 00 00 jne 0x261
10: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
17: fc ff df
1a: 4c 8b 63 08 mov 0x8(%rbx),%r12
1e: 49 8d 7c 24 30 lea 0x30(%r12),%rdi
23: 48 89 fa mov %rdi,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction
2e: 0f 85 23 02 00 00 jne 0x257
34: 4d 8b 64 24 30 mov 0x30(%r12),%r12
39: 4d 85 e4 test %r12,%r12
3c: 0f .byte 0xf
3d: 84 58 01 test %bl,0x1(%rax)