[Android 5.15] KASAN: use-after-free Read in vlan_dev_get_iflink

0 views
Skip to first unread message

syzbot

unread,
Oct 31, 2025, 1:51:30 PM (4 days ago) Oct 31
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 1edb21e89ce4 Revert "PCI/AER: Support errors introduced by..
git tree: android13-5.15-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=14fe9fe2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=aba6efd42433473
dashboard link: https://syzkaller.appspot.com/bug?extid=4234cb99239796b6887b
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10e12bcd980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13599704580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e308da3e59d7/disk-1edb21e8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f0b896dbae08/vmlinux-1edb21e8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/231ef8b054bf/bzImage-1edb21e8.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/1cd9f2c38cd4/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=15599704580000)

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

==================================================================
BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x6d/0x70 net/8021q/vlan_dev.c:766
Read of size 4 at addr ffff8881226e00d0 by task kworker/u4:0/8

CPU: 0 PID: 8 Comm: kworker/u4:0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Workqueue: netns cleanup_net
Call Trace:
<TASK>
__dump_stack+0x21/0x30 lib/dump_stack.c:88
dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0xf1/0x140 mm/kasan/report.c:444
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
vlan_dev_get_iflink+0x6d/0x70 net/8021q/vlan_dev.c:766
dev_get_iflink+0x70/0xc0 net/core/dev.c:711
default_operstate net/core/link_watch.c:41 [inline]
rfc2863_policy+0x124/0x2b0 net/core/link_watch.c:53
linkwatch_do_dev+0x3b/0x160 net/core/link_watch.c:160
linkwatch_forget_dev+0x170/0x180 net/core/link_watch.c:238
netdev_run_todo+0x2af/0x990 net/core/dev.c:10687
rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112
default_device_exit_batch+0x335/0x390 net/core/dev.c:11684
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x602/0xad0 net/core/net_namespace.c:599
process_one_work+0x6be/0xba0 kernel/workqueue.c:2325
worker_thread+0xa59/0x1200 kernel/workqueue.c:2472
kthread+0x411/0x500 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>

Allocated by task 362:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
____kasan_kmalloc mm/kasan/common.c:512 [inline]
__kasan_kmalloc+0xda/0x110 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
__kmalloc+0x13d/0x2c0 mm/slub.c:4436
__kmalloc_node include/linux/slab.h:487 [inline]
kmalloc_node include/linux/slab.h:642 [inline]
kvmalloc_node+0x206/0x300 mm/util.c:621
kvmalloc include/linux/mm.h:862 [inline]
kvzalloc include/linux/mm.h:870 [inline]
alloc_netdev_mqs+0x8d/0xc90 net/core/dev.c:10900
rtnl_create_link+0x2ef/0x9d0 net/core/rtnetlink.c:3232
__rtnl_newlink net/core/rtnetlink.c:3514 [inline]
rtnl_newlink+0x103f/0x17b0 net/core/rtnetlink.c:3572
rtnetlink_rcv_msg+0x9e4/0xb90 net/core/rtnetlink.c:5650
netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2511
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5668
netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline]
netlink_unicast+0x876/0xa40 net/netlink/af_netlink.c:1348
netlink_sendmsg+0x86a/0xb70 net/netlink/af_netlink.c:1922
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+0xe5/0x100 net/socket.c:2071
x64_sys_call+0x178/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
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 8:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
kasan_slab_free include/linux/kasan.h:193 [inline]
slab_free_hook mm/slub.c:1728 [inline]
slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754
slab_free mm/slub.c:3526 [inline]
kfree+0xc4/0x270 mm/slub.c:4588
kvfree+0x35/0x40 mm/util.c:661
netdev_freemem+0x3f/0x60 net/core/dev.c:10854
netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1903
device_release+0x96/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+0x18a/0x270 lib/kobject.c:761
netdev_run_todo+0x812/0x990 net/core/dev.c:10710
rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112
default_device_exit_batch+0x335/0x390 net/core/dev.c:11684
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x602/0xad0 net/core/net_namespace.c:599
process_one_work+0x6be/0xba0 kernel/workqueue.c:2325
worker_thread+0xa59/0x1200 kernel/workqueue.c:2472
kthread+0x411/0x500 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff8881226e0000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 208 bytes inside of
4096-byte region [ffff8881226e0000, ffff8881226e1000)
The buggy address belongs to the page:
page:ffffea000489b800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1226e0
head:ffffea000489b800 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 0000000000000000 dead000000000122 ffff888100043380
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
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 362, ts 26318180519, free_ts 25163316112
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605
prep_new_page+0x1c/0x110 mm/page_alloc.c:2611
get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485
__alloc_pages+0x18f/0x440 mm/page_alloc.c:5808
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab mm/slub.c:1937 [inline]
new_slab+0xa1/0x4d0 mm/slub.c:2000
___slab_alloc+0x381/0x810 mm/slub.c:3033
__slab_alloc+0x49/0x90 mm/slub.c:3120
slab_alloc_node mm/slub.c:3211 [inline]
slab_alloc mm/slub.c:3255 [inline]
kmem_cache_alloc_trace+0x146/0x270 mm/slub.c:3272
kmalloc include/linux/slab.h:619 [inline]
kzalloc include/linux/slab.h:750 [inline]
kobject_uevent_env+0x272/0x700 lib/kobject_uevent.c:539
kobject_uevent+0x1d/0x30 lib/kobject_uevent.c:657
__kobject_del+0xd7/0x2f0 lib/kobject.c:625
kobject_cleanup lib/kobject.c:704 [inline]
kobject_release lib/kobject.c:744 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x1db/0x270 lib/kobject.c:761
net_rx_queue_update_kobjects+0x40e/0x480 net/core/net-sysfs.c:1124
netif_set_real_num_rx_queues+0x107/0x1f0 net/core/dev.c:3027
veth_init_queues+0x116/0x180 drivers/net/veth.c:1613
veth_newlink+0xab7/0xda0 drivers/net/veth.c:1732
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1472 [inline]
free_pcp_prepare mm/page_alloc.c:1544 [inline]
free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534
free_unref_page+0xa2/0x550 mm/page_alloc.c:3616
free_the_page mm/page_alloc.c:805 [inline]
__free_pages+0x6c/0x100 mm/page_alloc.c:5884
__vunmap+0x84d/0x9e0 mm/vmalloc.c:2660
__vfree mm/vmalloc.c:2709 [inline]
vfree+0x8b/0xc0 mm/vmalloc.c:2740
kcov_put kernel/kcov.c:417 [inline]
kcov_close+0x2b/0x50 kernel/kcov.c:519
__fput+0x20b/0x8b0 fs/file_table.c:311
____fput+0x15/0x20 fs/file_table.c:339
task_work_run+0x127/0x190 kernel/task_work.c:188
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0xa7e/0x27a0 kernel/exit.c:889
do_group_exit+0x141/0x310 kernel/exit.c:1003
get_signal+0x66a/0x1480 kernel/signal.c:2907
arch_do_signal_or_restart+0xc1/0x10f0 arch/x86/kernel/signal.c:867
handle_signal_work kernel/entry/common.c:154 [inline]
exit_to_user_mode_loop+0xa7/0xe0 kernel/entry/common.c:178
exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:307

Memory state around the buggy address:
ffff8881226dff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881226e0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881226e0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881226e0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881226e0180: 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 syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

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