syzbot


KASAN: slab-out-of-bounds Read in get_mem_cgroup_from_objcg

Status: upstream: reported on 2025/09/22 17:50
Reported-by: syzbot+cc015fceaff81e28af3d@syzkaller.appspotmail.com
First crash: 70d, last: 70d

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in css_tryget include/linux/cgroup.h:354 [inline]
BUG: KASAN: slab-out-of-bounds in get_mem_cgroup_from_objcg+0xbf/0x120 mm/memcontrol.c:2815
Read of size 4 at addr ffff888060b0a8dc by task syz-executor/4181

CPU: 1 PID: 4181 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 css_tryget include/linux/cgroup.h:354 [inline]
 get_mem_cgroup_from_objcg+0xbf/0x120 mm/memcontrol.c:2815
 obj_cgroup_uncharge_pages mm/memcontrol.c:2992 [inline]
 refill_obj_stock+0x248/0x440 mm/memcontrol.c:3259
 memcg_slab_free_hook+0x157/0x1f0 mm/slab.h:364
 do_slab_free mm/slub.c:3437 [inline]
 ___cache_free+0x63/0x120 mm/slub.c:3511
 qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3225 [inline]
 kmem_cache_alloc_node_trace+0x13d/0x300 mm/slub.c:3275
 kmalloc_node include/linux/slab.h:622 [inline]
 kzalloc_node include/linux/slab.h:746 [inline]
 __get_vm_area_node+0x119/0x2d0 mm/vmalloc.c:2423
 __vmalloc_node_range+0xef/0x8b0 mm/vmalloc.c:3027
 __vmalloc_node mm/vmalloc.c:3087 [inline]
 vzalloc+0x75/0x80 mm/vmalloc.c:3157
 __do_replace+0xa5/0x9a0 net/ipv4/netfilter/ip_tables.c:1047
 do_replace net/ipv4/netfilter/ip_tables.c:1142 [inline]
 do_ipt_set_ctl+0xa04/0xcf0 net/ipv4/netfilter/ip_tables.c:1636
 nf_setsockopt+0x25f/0x280 net/netfilter/nf_sockopt.c:101
 ip_setsockopt+0x2127/0x3070 net/ipv4/ip_sockglue.c:1442
 tcp_setsockopt+0x21a/0x1d70 net/ipv4/tcp.c:3713
 __sys_setsockopt+0x2bf/0x3d0 net/socket.c:2203
 __do_sys_setsockopt net/socket.c:2214 [inline]
 __se_sys_setsockopt net/socket.c:2211 [inline]
 __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2211
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f34fcd9bdba
Code: ff ff ff c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 49 89 ca b8 36 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 06 c3 0f 1f 44 00 00 48 c7 c2 a8 ff ff ff f7
RSP: 002b:00007ffebc431c48 EFLAGS: 00000206 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007ffebc431cd0 RCX: 00007f34fcd9bdba
RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000003 R08: 0000000000000408 R09: 00007ffebc432087
R10: 00007f34fcfc0c40 R11: 0000000000000206 R12: 00007f34fcfc0be0
R13: 00007ffebc431c6c R14: 0000000000000000 R15: 00007f34fcfc2020
 </TASK>

Allocated by task 4181:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:735 [inline]
 class_dir_create_and_add drivers/base/core.c:2957 [inline]
 get_device_parent+0x2d6/0x3f0 drivers/base/core.c:3021
 device_add+0x335/0xfb0 drivers/base/core.c:3333
 wiphy_register+0x1d67/0x2b20 net/wireless/core.c:919
 ieee80211_register_hw+0x29b1/0x39d0 net/mac80211/main.c:1308
 mac80211_hwsim_new_radio+0x20d3/0x4080 drivers/net/wireless/mac80211_hwsim.c:3374
 hwsim_new_radio_nl+0xa6f/0xc40 drivers/net/wireless/mac80211_hwsim.c:3950
 genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline]
 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline]
 genl_rcv_msg+0xbc6/0xf40 net/netlink/genetlink.c:792
 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2507
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x774/0x920 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x8ab/0xbc0 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 __sys_sendto+0x423/0x580 net/socket.c:2063
 __do_sys_sendto net/socket.c:2075 [inline]
 __se_sys_sendto net/socket.c:2071 [inline]
 __x64_sys_sendto+0xda/0xf0 net/socket.c:2071
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff888060b0a880
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 92 bytes inside of
 96-byte region [ffff888060b0a880, ffff888060b0a8e0)
The buggy address belongs to the page:
page:ffffea000182c280 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888060b0ab00 pfn:0x60b0a
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea000080ec08 ffffea0001d1d608 ffff888016841780
raw: ffff888060b0ab00 000000000020000c 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 4195, ts 57340279614, free_ts 11305938209
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
 alloc_slab_page mm/slub.c:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 kmem_cache_alloc_trace+0x1a5/0x2a0 mm/slub.c:3250
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:735 [inline]
 nsim_fib6_rt_create drivers/net/netdevsim/fib.c:545 [inline]
 nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:750 [inline]
 nsim_fib6_event drivers/net/netdevsim/fib.c:854 [inline]
 nsim_fib_event drivers/net/netdevsim/fib.c:887 [inline]
 nsim_fib_event_work+0x1109/0x3240 drivers/net/netdevsim/fib.c:1483
 process_one_work+0x863/0x1000 kernel/workqueue.c:2310
 process_scheduled_works kernel/workqueue.c:2373 [inline]
 worker_thread+0xdca/0x12a0 kernel/workqueue.c:2459
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page+0x94/0x280 mm/page_alloc.c:3396
 free_contig_range+0x96/0xf0 mm/page_alloc.c:9406
 destroy_args+0x100/0xa20 mm/debug_vm_pgtable.c:1018
 debug_vm_pgtable+0x318/0x370 mm/debug_vm_pgtable.c:1336
 do_one_initcall+0x1ee/0x680 init/main.c:1302
 do_initcall_level+0x137/0x1f0 init/main.c:1375
 do_initcalls+0x4b/0x90 init/main.c:1391
 kernel_init_freeable+0x3ce/0x560 init/main.c:1615
 kernel_init+0x19/0x1b0 init/main.c:1506
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
 ffff888060b0a780: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff888060b0a800: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
>ffff888060b0a880: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
                                                    ^
 ffff888060b0a900: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
 ffff888060b0a980: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/22 17:50 linux-5.15.y 43bb85222e53 0ac7291c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in get_mem_cgroup_from_objcg
* Struck through repros no longer work on HEAD.