[v5.15] KASAN: use-after-free Read in vlan_dev_get_iflink (2)

0 views
Skip to first unread message

syzbot

unread,
2:21 AM (6 hours ago) 2:21 AM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 43bb85222e53 Linux 5.15.193
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14fdbb62580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e1bb6d24ef2164eb
dashboard link: https://syzkaller.appspot.com/bug?extid=5034efde9ae8c2138cf0
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/aa8fda38f146/disk-43bb8522.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5cfcd43783fc/vmlinux-43bb8522.xz
kernel image: https://storage.googleapis.com/syzbot-assets/582ede77e278/bzImage-43bb8522.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+5034ef...@syzkaller.appspotmail.com

IPv6: ADDRCONF(NETDEV_CHANGE): veth1_virt_wifi: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0_virt_wifi: link becomes ready
==================================================================
BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x68/0x70 net/8021q/vlan_dev.c:766
Read of size 4 at addr ffff88807b1360d0 by task kworker/u4:4/1275

CPU: 0 PID: 1275 Comm: kworker/u4:4 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Workqueue: events_unbound linkwatch_event
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
vlan_dev_get_iflink+0x68/0x70 net/8021q/vlan_dev.c:766
default_operstate net/core/link_watch.c:41 [inline]
rfc2863_policy+0xfd/0x280 net/core/link_watch.c:53
linkwatch_do_dev+0x38/0x160 net/core/link_watch.c:160
__linkwatch_run_queue+0x4a9/0x7b0 net/core/link_watch.c:213
linkwatch_event+0x48/0x50 net/core/link_watch.c:252
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
</TASK>

Allocated by task 4616:
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_node include/linux/slab.h:627 [inline]
kvmalloc_node+0x84/0x130 mm/util.c:619
kvmalloc include/linux/mm.h:816 [inline]
kvzalloc include/linux/mm.h:824 [inline]
alloc_netdev_mqs+0x84/0xc40 net/core/dev.c:10884
rtnl_create_link+0x2fb/0xa90 net/core/rtnetlink.c:3232
__rtnl_newlink net/core/rtnetlink.c:3514 [inline]
rtnl_newlink+0x105e/0x17d0 net/core/rtnetlink.c:3572
rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650
netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2507
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

Freed by task 4361:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1710 [inline]
slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
slab_free mm/slub.c:3504 [inline]
kfree+0xef/0x2a0 mm/slub.c:4564
device_release+0x92/0x1c0 drivers/base/core.c:-1
kobject_cleanup lib/kobject.c:713 [inline]
kobject_release lib/kobject.c:744 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x21d/0x460 lib/kobject.c:761
netdev_run_todo+0x8d0/0xa40 net/core/dev.c:10702
default_device_exit_batch+0x33b/0x390 net/core/dev.c:11668
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x77b/0xb80 net/core/net_namespace.c:635
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff88807b136000
which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 208 bytes inside of
4096-byte region [ffff88807b136000, ffff88807b137000)
The buggy address belongs to the page:
page:ffffea0001ec4c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b130
head:ffffea0001ec4c00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88802a0e8b81
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff88801684c280
raw: 0000000000000000 0000000000040004 00000001ffffffff ffff88802a0e8b81
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4519, ts 71795384389, free_ts 71781306238
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]
__kmalloc_node+0x200/0x3b0 mm/slub.c:4456
kmalloc_node include/linux/slab.h:627 [inline]
kvmalloc_node+0x84/0x130 mm/util.c:619
kvmalloc include/linux/mm.h:816 [inline]
kvzalloc include/linux/mm.h:824 [inline]
alloc_netdev_mqs+0x84/0xc40 net/core/dev.c:10884
vti6_init_net+0x100/0x2c0 net/ipv6/ip6_vti.c:1152
ops_init+0x357/0x600 net/core/net_namespace.c:138
setup_net+0x38d/0x9f0 net/core/net_namespace.c:333
copy_net_ns+0x348/0x5b0 net/core/net_namespace.c:503
create_new_namespaces+0x3d3/0x6f0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x116/0x160 kernel/nsproxy.c:226
ksys_unshare+0x4bc/0x890 kernel/fork.c:3175
__do_sys_unshare kernel/fork.c:3249 [inline]
__se_sys_unshare kernel/fork.c:3247 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3247
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
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_slab mm/slub.c:2020 [inline]
discard_slab mm/slub.c:2026 [inline]
__unfreeze_partials+0x1a5/0x200 mm/slub.c:2512
put_cpu_partial+0x12d/0x190 mm/slub.c:2592
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]
slab_alloc mm/slub.c:3233 [inline]
__kmalloc_track_caller+0x125/0x330 mm/slub.c:4930
kvasprintf+0xd4/0x180 lib/kasprintf.c:25
kobject_set_name_vargs+0x5d/0x110 lib/kobject.c:297
kobject_add_varg lib/kobject.c:392 [inline]
kobject_init_and_add+0xda/0x190 lib/kobject.c:481
netdev_queue_add_kobject net/core/net-sysfs.c:1666 [inline]
netdev_queue_update_kobjects+0x19c/0x3e0 net/core/net-sysfs.c:1711
register_queue_kobjects net/core/net-sysfs.c:1772 [inline]
netdev_register_kobject+0x265/0x310 net/core/net-sysfs.c:2018
register_netdevice+0x1019/0x16b0 net/core/dev.c:10397
veth_newlink+0x668/0xda0 drivers/net/veth.c:1683

Memory state around the buggy address:
ffff88807b135f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807b136000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807b136080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807b136100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807b136180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages