================================================================== BUG: KASAN: slab-out-of-bounds in selinux_sock security/selinux/include/objsec.h:207 [inline] BUG: KASAN: slab-out-of-bounds in selinux_ip_output+0x1b8/0x1c0 security/selinux/hooks.c:5746 Read of size 8 at addr ffff8880666985f0 by task kworker/u8:1/12 CPU: 0 UID: 0 PID: 12 Comm: kworker/u8:1 Not tainted 6.12.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Workqueue: krdsd rds_tcp_accept_worker Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xc7/0x130 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 selinux_sock security/selinux/include/objsec.h:207 [inline] selinux_ip_output+0x1b8/0x1c0 security/selinux/hooks.c:5746 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_slow+0xbb/0x1f0 net/netfilter/core.c:626 nf_hook include/linux/netfilter.h:269 [inline] __ip_local_out+0x428/0x710 net/ipv4/ip_output.c:119 ip_local_out net/ipv4/ip_output.c:128 [inline] ip_send_skb net/ipv4/ip_output.c:1505 [inline] ip_push_pending_frames+0x9b/0x4d0 net/ipv4/ip_output.c:1525 ip_send_unicast_reply+0xe14/0x13e0 net/ipv4/ip_output.c:1672 tcp_v4_send_ack+0x8c9/0x1150 net/ipv4/tcp_ipv4.c:1024 tcp_v4_timewait_ack net/ipv4/tcp_ipv4.c:1076 [inline] tcp_v4_rcv+0x3116/0x4530 net/ipv4/tcp_ipv4.c:2427 ip_protocol_deliver_rcu+0x6e/0x400 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2c7/0x3f0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ip_local_deliver+0x1be/0x360 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:460 [inline] ip_rcv_finish net/ipv4/ip_input.c:449 [inline] NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ip_rcv+0x400/0x6a0 net/ipv4/ip_input.c:569 __netif_receive_skb_one_core+0x199/0x1e0 net/core/dev.c:5668 __netif_receive_skb+0x1d/0x160 net/core/dev.c:5781 process_backlog+0x288/0xd40 net/core/dev.c:6113 __napi_poll+0xbb/0x6d0 net/core/dev.c:6777 napi_poll net/core/dev.c:6846 [inline] net_rx_action+0xa37/0xf80 net/core/dev.c:6968 handle_softirqs+0x248/0x660 kernel/softirq.c:554 do_softirq kernel/softirq.c:455 [inline] do_softirq+0x7a/0xa0 kernel/softirq.c:442 __local_bh_enable_ip+0x60/0x70 kernel/softirq.c:382 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:919 [inline] __dev_queue_xmit+0xba2/0x3a20 net/core/dev.c:4457 dev_queue_xmit include/linux/netdevice.h:3122 [inline] neigh_hh_output include/net/neighbour.h:526 [inline] neigh_output include/net/neighbour.h:540 [inline] ip_finish_output2+0xbc7/0x1a60 net/ipv4/ip_output.c:236 __ip_finish_output.part.0+0x1bf/0x360 net/ipv4/ip_output.c:314 __ip_finish_output include/net/dst.h:450 [inline] ip_finish_output net/ipv4/ip_output.c:324 [inline] NF_HOOK_COND include/linux/netfilter.h:303 [inline] ip_output+0x2b5/0xa10 net/ipv4/ip_output.c:434 dst_output include/net/dst.h:450 [inline] ip_local_out net/ipv4/ip_output.c:130 [inline] __ip_queue_xmit+0x1792/0x1d60 net/ipv4/ip_output.c:536 __tcp_transmit_skb+0x2d34/0x3ab0 net/ipv4/tcp_output.c:1466 tcp_transmit_skb net/ipv4/tcp_output.c:1484 [inline] tcp_write_xmit+0x101f/0x7610 net/ipv4/tcp_output.c:2827 __tcp_push_pending_frames+0xaf/0x390 net/ipv4/tcp_output.c:3012 tcp_send_fin+0x154/0xc70 net/ipv4/tcp_output.c:3618 __tcp_close+0x94c/0xed0 net/ipv4/tcp.c:3130 tcp_close+0x28/0x120 net/ipv4/tcp.c:3221 inet_release+0xea/0x200 net/ipv4/af_inet.c:437 inet6_release+0x4f/0x70 net/ipv6/af_inet6.c:489 __sock_release net/socket.c:658 [inline] sock_release+0x8e/0x1d0 net/socket.c:686 rds_tcp_accept_one+0x348/0xcf0 net/rds/tcp_listen.c:234 rds_tcp_accept_worker+0x46/0x70 net/rds/tcp.c:531 process_one_work+0x8a9/0x18a0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x86d/0x1110 kernel/workqueue.c:3391 kthread+0x2a6/0x380 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 ffff888066698580 which belongs to the cache tw_sock_TCP of size 288 The buggy address is located 112 bytes inside of allocated 288-byte region [ffff888066698580, ffff8880666986a0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x66698 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88801d1b6901 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff888014aa3dc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080170017 00000001f5000000 ffff88801d1b6901 head: 00fff00000000040 ffff888014aa3dc0 dead000000000122 0000000000000000 head: 0000000000000000 0000000080170017 00000001f5000000 ffff88801d1b6901 head: 00fff00000000001 ffffea000199a601 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 4693, tgid 4691 (syz-execprog), ts 48388902073, free_ts 48387971279 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x283/0x300 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0xff0/0x3a40 mm/page_alloc.c:3457 __alloc_pages_noprof+0x1cf/0x4a0 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x2c9/0x5f0 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab+0x280/0x390 mm/slub.c:2578 new_slab mm/slub.c:2631 [inline] ___slab_alloc+0xc2a/0x13f0 mm/slub.c:3818 __slab_alloc.constprop.0+0x4d/0x90 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x30c/0x350 mm/slub.c:4141 inet_twsk_alloc+0x120/0x970 net/ipv4/inet_timewait_sock.c:188 tcp_time_wait+0x5a/0xd70 net/ipv4/tcp_minisocks.c:309 tcp_fin+0x442/0x670 net/ipv4/tcp_input.c:4604 tcp_data_queue+0x1f9f/0x4dc0 net/ipv4/tcp_input.c:5290 tcp_rcv_state_process+0x193a/0x4db0 net/ipv4/tcp_input.c:6972 tcp_v4_do_rcv+0x397/0xac0 net/ipv4/tcp_ipv4.c:1938 tcp_v4_rcv+0x34e9/0x4530 net/ipv4/tcp_ipv4.c:2350 ip_protocol_deliver_rcu+0x6e/0x400 net/ipv4/ip_input.c:205 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:1108 [inline] free_unref_page+0x687/0xe60 mm/page_alloc.c:2638 mm_free_pgd kernel/fork.c:803 [inline] __mmdrop+0x59/0x370 kernel/fork.c:919 mmdrop include/linux/sched/mm.h:55 [inline] mmdrop_sched include/linux/sched/mm.h:83 [inline] mmdrop_lazy_tlb_sched include/linux/sched/mm.h:110 [inline] finish_task_switch.isra.0+0x569/0x7b0 kernel/sched/core.c:5221 context_switch kernel/sched/core.c:5325 [inline] __schedule+0x10ee/0x4f40 kernel/sched/core.c:6682 __schedule_loop kernel/sched/core.c:6759 [inline] schedule+0x7c/0x2c0 kernel/sched/core.c:6774 schedule_hrtimeout_range_clock+0x2f5/0x320 kernel/time/hrtimer.c:2272 do_sigtimedwait+0x3ee/0x560 kernel/signal.c:3665 __do_sys_rt_sigtimedwait kernel/signal.c:3709 [inline] __se_sys_rt_sigtimedwait kernel/signal.c:3687 [inline] __x64_sys_rt_sigtimedwait+0x1ec/0x2e0 kernel/signal.c:3687 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x6d/0x1a0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888066698480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888066698500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888066698580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888066698600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888066698680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================