Hello,
syzbot found the following issue on:
HEAD commit: ba8b8b193394 Revert "can: statistics: use atomic access in..
git tree: android13-5.10-lts
console+strace:
https://syzkaller.appspot.com/x/log.txt?x=155cb4cc580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=d0d5a25afd717f7c
dashboard link:
https://syzkaller.appspot.com/bug?extid=89debf5200e40e988a32
compiler: Debian clang version 15.0.6, Debian LLD 15.0.6
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=15cc3470580000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=1724d204580000
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/024c8f4768cd/disk-ba8b8b19.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/b9fb5931f0e6/vmlinux-ba8b8b19.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/2d8539f82fe0/bzImage-ba8b8b19.xz
mounted in repro:
https://storage.googleapis.com/syzbot-assets/7affc7340942/mount_0.gz
fsck result: OK (log:
https://syzkaller.appspot.com/x/fsck.log?x=10df063f980000)
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+89debf...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x70/0x80 net/8021q/vlan_dev.c:780
Read of size 4 at addr ffff88811fdf4100 by task kworker/u4:2/49
CPU: 0 PID: 49 Comm: kworker/u4:2 Not tainted 5.10.236-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Workqueue: netns cleanup_net
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118
print_address_description+0x81/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:452
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
vlan_dev_get_iflink+0x70/0x80 net/8021q/vlan_dev.c:780
dev_get_iflink+0x6f/0xc0 net/core/dev.c:824
default_operstate net/core/link_watch.c:41 [inline]
rfc2863_policy+0x127/0x2b0 net/core/link_watch.c:53
linkwatch_do_dev+0x3c/0x140 net/core/link_watch.c:160
linkwatch_forget_dev+0x170/0x180 net/core/link_watch.c:238
netdev_wait_allrefs net/core/dev.c:10214 [inline]
netdev_run_todo+0x2ee/0xdc0 net/core/dev.c:10330
rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112
default_device_exit_batch+0x38f/0x3f0 net/core/dev.c:11287
ops_exit_list net/core/net_namespace.c:190 [inline]
cleanup_net+0x6e9/0xcb0 net/core/net_namespace.c:609
process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301
worker_thread+0xaea/0x1510 kernel/workqueue.c:2447
kthread+0x34b/0x3d0 kernel/kthread.c:313
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
Allocated by task 289:
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:430 [inline]
____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:509
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:518
kasan_kmalloc include/linux/kasan.h:254 [inline]
__kmalloc+0x1aa/0x330 mm/slub.c:4033
__kmalloc_node include/linux/slab.h:418 [inline]
kmalloc_node include/linux/slab.h:575 [inline]
kvmalloc_node+0x82/0x130 mm/util.c:612
kvmalloc include/linux/mm.h:822 [inline]
kvzalloc include/linux/mm.h:830 [inline]
alloc_netdev_mqs+0x8e/0xcd0 net/core/dev.c:10526
rtnl_create_link+0x240/0x950 net/core/rtnetlink.c:3195
__rtnl_newlink net/core/rtnetlink.c:3472 [inline]
rtnl_newlink+0x1399/0x2000 net/core/rtnetlink.c:3530
rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5610
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2485
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5628
netlink_unicast_kernel net/netlink/af_netlink.c:1307 [inline]
netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1333
netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1901
sock_sendmsg_nosec net/socket.c:652 [inline]
__sock_sendmsg net/socket.c:664 [inline]
__sys_sendto+0x545/0x700 net/socket.c:2006
__do_sys_sendto net/socket.c:2018 [inline]
__se_sys_sendto net/socket.c:2014 [inline]
__x64_sys_sendto+0xe5/0x100 net/socket.c:2014
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Freed by task 49:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:370
kasan_slab_free include/linux/kasan.h:220 [inline]
slab_free_hook mm/slub.c:1595 [inline]
slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621
slab_free mm/slub.c:3203 [inline]
kfree+0xc3/0x270 mm/slub.c:4191
kvfree+0x35/0x40 mm/util.c:647
netdev_freemem+0x3f/0x60 net/core/dev.c:10480
netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1886
device_release+0x95/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+0x178/0x260 lib/kobject.c:761
netdev_run_todo+0xc26/0xdc0 net/core/dev.c:10351
rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112
default_device_exit_batch+0x38f/0x3f0 net/core/dev.c:11287
ops_exit_list net/core/net_namespace.c:190 [inline]
cleanup_net+0x6e9/0xcb0 net/core/net_namespace.c:609
process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301
worker_thread+0xaea/0x1510 kernel/workqueue.c:2447
kthread+0x34b/0x3d0 kernel/kthread.c:313
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
The buggy address belongs to the object at ffff88811fdf4000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 256 bytes inside of
4096-byte region [ffff88811fdf4000, ffff88811fdf5000)
The buggy address belongs to the page:
page:ffffea00047f7c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11fdf0
head:ffffea00047f7c00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042c00
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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 289, ts 23351462488, free_ts 23347899040
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook mm/page_alloc.c:2456 [inline]
prep_new_page+0x166/0x180 mm/page_alloc.c:2462
get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254
__alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5349
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab mm/slub.c:1808 [inline]
new_slab+0x80/0x400 mm/slub.c:1869
new_slab_objects mm/slub.c:2627 [inline]
___slab_alloc+0x302/0x4b0 mm/slub.c:2791
__slab_alloc+0x63/0xa0 mm/slub.c:2831
slab_alloc_node mm/slub.c:2913 [inline]
slab_alloc mm/slub.c:2955 [inline]
__kmalloc_track_caller+0x1f8/0x320 mm/slub.c:4536
__kmalloc_reserve net/core/skbuff.c:144 [inline]
__alloc_skb+0xbc/0x510 net/core/skbuff.c:212
alloc_skb include/linux/skbuff.h:1126 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
rtmsg_ifinfo_build_skb+0x7f/0x180 net/core/rtnetlink.c:3844
rtmsg_ifinfo_event net/core/rtnetlink.c:3880 [inline]
rtmsg_ifinfo+0x78/0x120 net/core/rtnetlink.c:3889
__dev_notify_flags+0xdd/0x610 net/core/dev.c:8567
rtnl_configure_link net/core/rtnetlink.c:-1 [inline]
__rtnl_newlink net/core/rtnetlink.c:3490 [inline]
rtnl_newlink+0x18fd/0x2000 net/core/rtnetlink.c:3530
rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5610
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2485
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5628
netlink_unicast_kernel net/netlink/af_netlink.c:1307 [inline]
netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1333
page last free stack trace:
reset_page_owner include/linux/page_owner.h:28 [inline]
free_pages_prepare mm/page_alloc.c:1349 [inline]
__free_pages_ok+0x82c/0x850 mm/page_alloc.c:1629
free_compound_page+0x73/0x90 mm/page_alloc.c:710
destroy_compound_page include/linux/mm.h:959 [inline]
__put_compound_page+0x73/0xb0 mm/swap.c:117
__put_page+0xc0/0xe0 mm/swap.c:133
put_page include/linux/mm.h:1257 [inline]
page_to_skb+0x3f6/0x900 drivers/net/virtio_net.c:453
receive_mergeable drivers/net/virtio_net.c:1019 [inline]
receive_buf+0xe79/0x53d0 drivers/net/virtio_net.c:1129
virtnet_receive drivers/net/virtio_net.c:1421 [inline]
virtnet_poll+0x5df/0x1240 drivers/net/virtio_net.c:1530
napi_poll net/core/dev.c:6873 [inline]
net_rx_action+0x516/0x10d0 net/core/dev.c:6943
__do_softirq+0x268/0x5bb kernel/softirq.c:309
Memory state around the buggy address:
ffff88811fdf4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811fdf4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811fdf4100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88811fdf4180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88811fdf4200: 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