================================================================== BUG: KASAN: slab-use-after-free in dev_get_flags+0x209/0x250 net/core/dev.c:8786 Read of size 4 at addr ffff8880358e00b0 by task kworker/1:2/1460 CPU: 1 UID: 0 PID: 1460 Comm: kworker/1:2 Not tainted 6.12.0-rc6-syzkaller-00005-g557329bcecc2 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: infiniband ib_cache_event_task Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 dev_get_flags+0x209/0x250 net/core/dev.c:8786 rxe_query_port+0x13f/0x200 drivers/infiniband/sw/rxe/rxe_verbs.c:60 __ib_query_port drivers/infiniband/core/device.c:2111 [inline] ib_query_port drivers/infiniband/core/device.c:2143 [inline] ib_query_port+0x43e/0x8a0 drivers/infiniband/core/device.c:2133 ib_cache_update.part.0+0xdc/0xa30 drivers/infiniband/core/cache.c:1494 ib_cache_update drivers/infiniband/core/cache.c:1568 [inline] ib_cache_event_task+0x1c2/0x290 drivers/infiniband/core/cache.c:1568 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 34: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 skb_ext_maybe_cow net/core/skbuff.c:6942 [inline] skb_ext_add+0xf8/0x770 net/core/skbuff.c:7016 nf_bridge_unshare net/bridge/br_netfilter_hooks.c:169 [inline] br_nf_forward_ip.part.0+0x28/0x820 net/bridge/br_netfilter_hooks.c:709 br_nf_forward_ip net/bridge/br_netfilter_hooks.c:704 [inline] br_nf_forward+0xf11/0x1bd0 net/bridge/br_netfilter_hooks.c:801 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_slow+0xbb/0x200 net/netfilter/core.c:626 nf_hook+0x474/0x7d0 include/linux/netfilter.h:269 NF_HOOK include/linux/netfilter.h:312 [inline] __br_forward+0x1be/0x5b0 net/bridge/br_forward.c:115 deliver_clone+0x5b/0xa0 net/bridge/br_forward.c:131 br_flood+0x493/0x5c0 net/bridge/br_forward.c:245 br_handle_frame_finish+0xda5/0x1c80 net/bridge/br_input.c:215 br_nf_hook_thresh+0x303/0x410 net/bridge/br_netfilter_hooks.c:1195 br_nf_pre_routing_finish_ipv6+0x76a/0xfb0 net/bridge/br_netfilter_ipv6.c:154 NF_HOOK include/linux/netfilter.h:314 [inline] br_nf_pre_routing_ipv6+0x3ce/0x8c0 net/bridge/br_netfilter_ipv6.c:184 br_nf_pre_routing+0x860/0x15b0 net/bridge/br_netfilter_hooks.c:533 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_bridge_pre net/bridge/br_input.c:277 [inline] br_handle_frame+0x9eb/0x1490 net/bridge/br_input.c:424 __netif_receive_skb_core.constprop.0+0xa3d/0x4330 net/core/dev.c:5564 __netif_receive_skb_one_core+0xb1/0x1e0 net/core/dev.c:5668 __netif_receive_skb+0x1d/0x160 net/core/dev.c:5783 process_backlog+0x443/0x15f0 net/core/dev.c:6115 __napi_poll.constprop.0+0xb7/0x550 net/core/dev.c:6779 napi_poll net/core/dev.c:6848 [inline] net_rx_action+0xa92/0x1010 net/core/dev.c:6970 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 run_ksoftirqd kernel/softirq.c:927 [inline] run_ksoftirqd+0x3a/0x60 kernel/softirq.c:919 smpboot_thread_fn+0x661/0xa30 kernel/smpboot.c:164 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 34: 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:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x152/0x4b0 mm/slub.c:4681 __skb_ext_put+0x102/0x2c0 net/core/skbuff.c:7101 __skb_ext_del+0xf3/0x340 net/core/skbuff.c:7068 skb_ext_del include/linux/skbuff.h:4843 [inline] nf_bridge_info_free net/bridge/br_netfilter_hooks.c:156 [inline] br_nf_dev_queue_xmit+0x7a2/0x2a10 net/bridge/br_netfilter_hooks.c:947 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] br_nf_post_routing+0x8ee/0x11b0 net/bridge/br_netfilter_hooks.c:994 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_slow+0xbb/0x200 net/netfilter/core.c:626 nf_hook+0x474/0x7d0 include/linux/netfilter.h:269 NF_HOOK include/linux/netfilter.h:312 [inline] br_forward_finish+0xcd/0x130 net/bridge/br_forward.c:66 br_nf_hook_thresh+0x303/0x410 net/bridge/br_netfilter_hooks.c:1195 br_nf_forward_finish+0x66a/0xba0 net/bridge/br_netfilter_hooks.c:690 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] br_nf_forward_ip.part.0+0x610/0x820 net/bridge/br_netfilter_hooks.c:744 br_nf_forward_ip net/bridge/br_netfilter_hooks.c:704 [inline] br_nf_forward+0xf11/0x1bd0 net/bridge/br_netfilter_hooks.c:801 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_slow+0xbb/0x200 net/netfilter/core.c:626 nf_hook+0x474/0x7d0 include/linux/netfilter.h:269 NF_HOOK include/linux/netfilter.h:312 [inline] __br_forward+0x1be/0x5b0 net/bridge/br_forward.c:115 deliver_clone+0x5b/0xa0 net/bridge/br_forward.c:131 br_flood+0x493/0x5c0 net/bridge/br_forward.c:245 br_handle_frame_finish+0xda5/0x1c80 net/bridge/br_input.c:215 br_nf_hook_thresh+0x303/0x410 net/bridge/br_netfilter_hooks.c:1195 br_nf_pre_routing_finish_ipv6+0x76a/0xfb0 net/bridge/br_netfilter_ipv6.c:154 NF_HOOK include/linux/netfilter.h:314 [inline] br_nf_pre_routing_ipv6+0x3ce/0x8c0 net/bridge/br_netfilter_ipv6.c:184 br_nf_pre_routing+0x860/0x15b0 net/bridge/br_netfilter_hooks.c:533 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_bridge_pre net/bridge/br_input.c:277 [inline] br_handle_frame+0x9eb/0x1490 net/bridge/br_input.c:424 __netif_receive_skb_core.constprop.0+0xa3d/0x4330 net/core/dev.c:5564 __netif_receive_skb_one_core+0xb1/0x1e0 net/core/dev.c:5668 __netif_receive_skb+0x1d/0x160 net/core/dev.c:5783 process_backlog+0x443/0x15f0 net/core/dev.c:6115 __napi_poll.constprop.0+0xb7/0x550 net/core/dev.c:6779 napi_poll net/core/dev.c:6848 [inline] net_rx_action+0xa92/0x1010 net/core/dev.c:6970 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 run_ksoftirqd kernel/softirq.c:927 [inline] run_ksoftirqd+0x3a/0x60 kernel/softirq.c:919 smpboot_thread_fn+0x661/0xa30 kernel/smpboot.c:164 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff8880358e0000 which belongs to the cache skbuff_ext_cache of size 184 The buggy address is located 176 bytes inside of freed 184-byte region [ffff8880358e0000, ffff8880358e00b8) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x358e0 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801bb56b40 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 34, tgid 34 (ksoftirqd/3), ts 68450824459, free_ts 66359157028 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0xf7d/0x2d10 mm/page_alloc.c:3457 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4141 skb_ext_maybe_cow net/core/skbuff.c:6942 [inline] skb_ext_add+0xf8/0x770 net/core/skbuff.c:7016 nf_bridge_unshare net/bridge/br_netfilter_hooks.c:169 [inline] br_nf_forward_ip.part.0+0x28/0x820 net/bridge/br_netfilter_hooks.c:709 br_nf_forward_ip net/bridge/br_netfilter_hooks.c:704 [inline] br_nf_forward+0xf11/0x1bd0 net/bridge/br_netfilter_hooks.c:801 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_slow+0xbb/0x200 net/netfilter/core.c:626 nf_hook+0x474/0x7d0 include/linux/netfilter.h:269 NF_HOOK include/linux/netfilter.h:312 [inline] __br_forward+0x1be/0x5b0 net/bridge/br_forward.c:115 deliver_clone+0x5b/0xa0 net/bridge/br_forward.c:131 br_flood+0x493/0x5c0 net/bridge/br_forward.c:245 page last free pid 5927 tgid 5927 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2638 __put_partials+0x14c/0x170 mm/slub.c:3145 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4186 __alloc_skb+0x2b1/0x380 net/core/skbuff.c:668 alloc_skb_fclone include/linux/skbuff.h:1372 [inline] tcp_stream_alloc_skb+0x34/0x570 net/ipv4/tcp.c:885 tcp_sendmsg_locked+0xeb5/0x3750 net/ipv4/tcp.c:1167 tcp_sendmsg+0x2e/0x50 net/ipv4/tcp.c:1357 inet_sendmsg+0xb9/0x140 net/ipv4/af_inet.c:853 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg net/socket.c:744 [inline] sock_write_iter+0x4ac/0x5b0 net/socket.c:1165 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5ae/0x1150 fs/read_write.c:683 ksys_write+0x1fa/0x260 fs/read_write.c:736 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880358dff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880358e0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880358e0080: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc ^ ffff8880358e0100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880358e0180: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc ==================================================================