syzbot


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

Status: closed as invalid on 2024/04/25 09:15
Subsystems: net
[Documentation on labels]
First crash: 510d, last: 510d
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in xfrmi_exit_batch_rtnl net 19 2 405d 405d 0/29 closed as invalid on 2024/09/04 18:07

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in xfrmi_exit_batch_rtnl+0x165/0x2e0 net/xfrm/xfrm_interface_core.c:970
Read of size 8 at addr ffff88805bc3aca8 by task kworker/u8:1/11

CPU: 1 PID: 11 Comm: kworker/u8:1 Not tainted 6.8.0-syzkaller-05204-g237bb5f7f7f5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: netns cleanup_net
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0x169/0x550 mm/kasan/report.c:488
 kasan_report+0x143/0x180 mm/kasan/report.c:601
 xfrmi_exit_batch_rtnl+0x165/0x2e0 net/xfrm/xfrm_interface_core.c:970
 cleanup_net+0x709/0xcc0 net/core/net_namespace.c:630
 process_one_work kernel/workqueue.c:3254 [inline]
 process_scheduled_works+0xa00/0x1770 kernel/workqueue.c:3335
 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416
 kthread+0x2f0/0x390 kernel/kthread.c:388
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
 </TASK>

Allocated by task 31207:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
 __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slub.c:3981 [inline]
 __kmalloc_node_track_caller+0x24c/0x4e0 mm/slub.c:4001
 kmemdup+0x2a/0x60 mm/util.c:131
 __devinet_sysctl_register+0xb0/0x2b0 net/ipv4/devinet.c:2577
 devinet_sysctl_register+0x17e/0x1f0 net/ipv4/devinet.c:2629
 inetdev_init+0x296/0x4d0 net/ipv4/devinet.c:286
 inetdev_event+0x338/0x15c0 net/ipv4/devinet.c:1560
 notifier_call_chain+0x18f/0x3b0 kernel/notifier.c:93
 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline]
 call_netdevice_notifiers net/core/dev.c:2002 [inline]
 register_netdevice+0x15b2/0x1a20 net/core/dev.c:10307
 cfg80211_register_netdevice+0x149/0x2f0 net/wireless/core.c:1437
 ieee80211_if_add+0xbbf/0x1770 net/mac80211/iface.c:2211
 ieee80211_register_hw+0x321c/0x3d80 net/mac80211/main.c:1575
 mac80211_hwsim_new_radio+0x25ac/0x4550 drivers/net/wireless/virtual/mac80211_hwsim.c:5454
 hwsim_new_radio_nl+0xe4c/0x21d0 drivers/net/wireless/virtual/mac80211_hwsim.c:6135
 genl_family_rcv_msg_doit net/netlink/genetlink.c:1113 [inline]
 genl_family_rcv_msg net/netlink/genetlink.c:1193 [inline]
 genl_rcv_msg+0xb14/0xec0 net/netlink/genetlink.c:1208
 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2559
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1217
 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
 netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361
 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg+0x221/0x270 net/socket.c:745
 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2584
 ___sys_sendmsg net/socket.c:2638 [inline]
 __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667
 do_syscall_64+0xfb/0x240
 entry_SYSCALL_64_after_hwframe+0x6d/0x75

The buggy address belongs to the object at ffff88805bc3a000
 which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 1056 bytes to the right of
 allocated 2184-byte region [ffff88805bc3a000, ffff88805bc3a888)

The buggy address belongs to the physical page:
page:ffffea00016f0e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5bc38
head:ffffea00016f0e00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff88801e65ad81
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888014c4f500 ffffea0000aba000 dead000000000002
raw: 0000000000000000 0000000000040004 00000001ffffffff ffff88801e65ad81
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5085, tgid 5085 (udevd), ts 95366621000, free_ts 95363107000
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533
 prep_new_page mm/page_alloc.c:1540 [inline]
 get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311
 __alloc_pages+0x256/0x680 mm/page_alloc.c:4569
 __alloc_pages_node include/linux/gfp.h:238 [inline]
 alloc_pages_node include/linux/gfp.h:261 [inline]
 alloc_slab_page+0x5f/0x160 mm/slub.c:2190
 allocate_slab mm/slub.c:2354 [inline]
 new_slab+0x84/0x2f0 mm/slub.c:2407
 ___slab_alloc+0xd1b/0x13e0 mm/slub.c:3540
 __slab_alloc mm/slub.c:3625 [inline]
 __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+0x2d9/0x4e0 mm/slub.c:3988
 kmalloc_node include/linux/slab.h:610 [inline]
 kvmalloc_node+0x72/0x190 mm/util.c:634
 kvmalloc include/linux/slab.h:728 [inline]
 seq_buf_alloc fs/seq_file.c:38 [inline]
 seq_read_iter+0x202/0xd60 fs/seq_file.c:210
 call_read_iter include/linux/fs.h:2102 [inline]
 new_sync_read fs/read_write.c:395 [inline]
 vfs_read+0x97b/0xb70 fs/read_write.c:476
 ksys_read+0x1a0/0x2c0 fs/read_write.c:619
 do_syscall_64+0xfb/0x240
 entry_SYSCALL_64_after_hwframe+0x6d/0x75
page last free pid 6370 tgid 6370 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+0x968/0xa90 mm/page_alloc.c:2346
 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486
 discard_slab mm/slub.c:2453 [inline]
 __put_partials+0xeb/0x130 mm/slub.c:2922
 put_cpu_partial+0x17c/0x250 mm/slub.c:2997
 __slab_free+0x302/0x410 mm/slub.c:4166
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x5e/0xc0 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slub.c:3813 [inline]
 slab_alloc_node mm/slub.c:3860 [inline]
 kmem_cache_alloc+0x172/0x350 mm/slub.c:3867
 kmem_cache_zalloc include/linux/slab.h:701 [inline]
 lsm_inode_alloc security/security.c:670 [inline]
 security_inode_alloc+0x28/0x120 security/security.c:1579
 inode_init_always+0x947/0xc70 fs/inode.c:232
 alloc_inode fs/inode.c:268 [inline]
 new_inode_pseudo+0x9e/0x1e0 fs/inode.c:1007
 new_inode+0x22/0x1d0 fs/inode.c:1033
 __ext4_new_inode+0x35a/0x4360 fs/ext4/ialloc.c:958
 ext4_symlink+0x38d/0xb50 fs/ext4/namei.c:3395
 vfs_symlink+0x137/0x2a0 fs/namei.c:4482

Memory state around the buggy address:
 ffff88805bc3ab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88805bc3ac00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88805bc3ac80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                  ^
 ffff88805bc3ad00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88805bc3ad80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/29 05:52 net-next 237bb5f7f7f5 120789fd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-out-of-bounds Read in xfrmi_exit_batch_rtnl
* Struck through repros no longer work on HEAD.