x_tables: ip6_tables: rpfilter match: used from hooks OUTPUT, but only valid from PREROUTING ================================================================== BUG: KASAN: slab-out-of-bounds in nla_ok include/net/netlink.h:1230 [inline] BUG: KASAN: slab-out-of-bounds in nla_find+0x120/0x130 lib/nlattr.c:746 Read of size 2 at addr ffff8880295cabb6 by task syz-executor.3/6227 CPU: 1 PID: 6227 Comm: syz-executor.3 Not tainted 6.7.0-rc5-next-20231215-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 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+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 nla_ok include/net/netlink.h:1230 [inline] nla_find+0x120/0x130 lib/nlattr.c:746 nla_find_nested include/net/netlink.h:1260 [inline] ____bpf_skb_get_nlattr_nest net/core/filter.c:209 [inline] bpf_skb_get_nlattr_nest+0x178/0x1f0 net/core/filter.c:192 The buggy address belongs to the object at ffff8880295caa00 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 438 bytes inside of allocated 640-byte region [ffff8880295caa00, ffff8880295cac80) The buggy address belongs to the physical page: page:ffffea0000a57200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x295c8 head:ffffea0000a57200 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff8881416d3280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080150015 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 6226, tgid 6225 (syz-executor.0), ts 391845975180, free_ts 391578728347 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1540 prep_new_page mm/page_alloc.c:1547 [inline] get_page_from_freelist+0xa19/0x3740 mm/page_alloc.c:3355 __alloc_pages+0x22e/0x2410 mm/page_alloc.c:4611 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:2191 [inline] allocate_slab mm/slub.c:2358 [inline] new_slab+0x283/0x3c0 mm/slub.c:2411 ___slab_alloc+0x4ab/0x1990 mm/slub.c:3544 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3629 __slab_alloc_node mm/slub.c:3682 [inline] slab_alloc_node mm/slub.c:3854 [inline] kmem_cache_alloc_node+0x10a/0x340 mm/slub.c:3907 kmalloc_reserve+0x166/0x260 net/core/skbuff.c:560 __alloc_skb+0x12b/0x330 net/core/skbuff.c:651 skb_copy+0x12c/0x2e0 net/core/skbuff.c:1981 mac80211_hwsim_tx_frame_no_nl.isra.0+0xb94/0x1300 drivers/net/wireless/virtual/mac80211_hwsim.c:1835 mac80211_hwsim_tx_frame+0x1eb/0x2a0 drivers/net/wireless/virtual/mac80211_hwsim.c:2171 mac80211_hwsim_beacon_tx+0x41b/0x740 drivers/net/wireless/virtual/mac80211_hwsim.c:2264 __iterate_interfaces+0x2d2/0x580 net/mac80211/util.c:767 ieee80211_iterate_active_interfaces_atomic+0x71/0x1b0 net/mac80211/util.c:803 page last free pid 923 tgid 923 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+0x51f/0xb10 mm/page_alloc.c:2390 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2530 usbhid_probe+0xee2/0x1360 drivers/hid/usbhid/hid-core.c:1438 usb_probe_interface+0x307/0x930 drivers/usb/core/driver.c:399 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x117e/0x1aa0 drivers/base/core.c:3625 usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2207 usb_generic_driver_probe+0xad/0x110 drivers/usb/core/generic.c:245 usb_probe_device+0xec/0x350 drivers/usb/core/driver.c:294 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 Memory state around the buggy address: ffff8880295caa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880295cab00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880295cab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880295cac00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880295cac80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================