[v6.1] KASAN: use-after-free Read in __dev_queue_xmit

8 views
Skip to first unread message

syzbot

unread,
Apr 29, 2023, 9:33:00 AM4/29/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ca1c9012c941 Linux 6.1.26
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1013bf0c280000
kernel config: https://syzkaller.appspot.com/x/.config?x=f749f501f45a424b
dashboard link: https://syzkaller.appspot.com/bug?extid=4b8abd8f290c98754eee
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/fa9c42c5de02/disk-ca1c9012.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/deeadb7af907/vmlinux-ca1c9012.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3b2d047683d5/bzImage-ca1c9012.xz

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

ieee802154 phy0 wpan0: encryption failed: -22
ieee802154 phy1 wpan1: encryption failed: -22
==================================================================
BUG: KASAN: use-after-free in skb_update_prio net/core/dev.c:3904 [inline]
BUG: KASAN: use-after-free in __dev_queue_xmit+0x7b4/0x3c20 net/core/dev.c:4184
Read of size 8 at addr ffff888091984b90 by task aoe_tx0/1255

CPU: 1 PID: 1255 Comm: aoe_tx0 Not tainted 6.1.26-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report+0x136/0x160 mm/kasan/report.c:495
skb_update_prio net/core/dev.c:3904 [inline]
__dev_queue_xmit+0x7b4/0x3c20 net/core/dev.c:4184
dev_queue_xmit include/linux/netdevice.h:3017 [inline]
tx+0x66/0x100 drivers/block/aoe/aoenet.c:63
kthread+0x234/0x440 drivers/block/aoe/aoecmd.c:1229
kthread+0x26e/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>

Allocated by task 19019:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc_node+0xb3/0x230 mm/slab_common.c:962
kmalloc_node include/linux/slab.h:579 [inline]
kvmalloc_node+0x6e/0x180 mm/util.c:581
kvmalloc include/linux/slab.h:706 [inline]
kvzalloc include/linux/slab.h:714 [inline]
alloc_netdev_mqs+0x85/0xeb0 net/core/dev.c:10583
sixpack_open+0xe6/0xa10 drivers/net/hamradio/6pack.c:558
tty_ldisc_open drivers/tty/tty_ldisc.c:433 [inline]
tty_set_ldisc+0x37a/0x680 drivers/tty/tty_ldisc.c:558
tty_ioctl+0xa61/0xbd0 drivers/tty/tty_io.c:2709
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 19018:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
device_release+0x91/0x1c0
kobject_cleanup lib/kobject.c:681 [inline]
kobject_release lib/kobject.c:712 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x224/0x460 lib/kobject.c:729
tty_ldisc_kill+0xa6/0x1a0 drivers/tty/tty_ldisc.c:608
tty_ldisc_release+0x19d/0x200 drivers/tty/tty_ldisc.c:776
tty_release_struct+0x27/0xd0 drivers/tty/tty_io.c:1689
tty_release+0xcfb/0x12a0 drivers/tty/tty_io.c:1860
__fput+0x3b7/0x890 fs/file_table.c:320
task_work_run+0x246/0x300 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888091984000
which belongs to the cache kmalloc-cg-8k of size 8192
The buggy address is located 2960 bytes inside of
8192-byte region [ffff888091984000, ffff888091986000)

The buggy address belongs to the physical page:
page:ffffea0002466000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x91980
head:ffffea0002466000 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88807b004961
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea000079a600 dead000000000002 ffff88801244c3c0
raw: 0000000000000000 0000000080020002 00000001ffffffff ffff88807b004961
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 14797, tgid 14796 (syz-executor.2), ts 1988818941704, free_ts 1988790321111
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533
prep_new_page mm/page_alloc.c:2540 [inline]
get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xa71/0x1080 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc_node+0xa2/0x230 mm/slab_common.c:962
kmalloc_node include/linux/slab.h:579 [inline]
kvmalloc_node+0x6e/0x180 mm/util.c:581
kvmalloc include/linux/slab.h:706 [inline]
kvzalloc include/linux/slab.h:714 [inline]
alloc_netdev_mqs+0x85/0xeb0 net/core/dev.c:10583
sixpack_open+0xe6/0xa10 drivers/net/hamradio/6pack.c:558
tty_ldisc_open drivers/tty/tty_ldisc.c:433 [inline]
tty_set_ldisc+0x37a/0x680 drivers/tty/tty_ldisc.c:558
tty_ioctl+0xa61/0xbd0 drivers/tty/tty_io.c:2709
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1460 [inline]
free_pcp_prepare mm/page_alloc.c:1510 [inline]
free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388
free_unref_page+0x98/0x570 mm/page_alloc.c:3484
free_slab mm/slub.c:2031 [inline]
discard_slab mm/slub.c:2037 [inline]
__unfreeze_partials+0x1b7/0x210 mm/slub.c:2586
put_cpu_partial+0x116/0x180 mm/slub.c:2662
qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x50/0x370 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422
sk_prot_alloc+0x58/0x200 net/core/sock.c:2026
sk_alloc+0x36/0x350 net/core/sock.c:2085
rds_create+0x83/0x4a0 net/rds/af_rds.c:706
__sock_create+0x460/0x8d0 net/socket.c:1520
sock_create net/socket.c:1571 [inline]
__sys_socket_create net/socket.c:1608 [inline]
__sys_socket+0x136/0x3a0 net/socket.c:1636
__do_sys_socket net/socket.c:1649 [inline]
__se_sys_socket net/socket.c:1647 [inline]
__x64_sys_socket+0x76/0x80 net/socket.c:1647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80

Memory state around the buggy address:
ffff888091984a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888091984b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888091984b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888091984c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888091984c80: 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 bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

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

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

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
May 28, 2023, 9:10:13 AM5/28/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: a343b0dd87b4 Linux 6.1.30
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17c34625280000
kernel config: https://syzkaller.appspot.com/x/.config?x=8ec86bd749598dca
dashboard link: https://syzkaller.appspot.com/bug?extid=4b8abd8f290c98754eee
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=178e8185280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1619c5f5280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/aebc00d6f042/disk-a343b0dd.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7ff0321ebb5a/vmlinux-a343b0dd.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c928974a56d6/Image-a343b0dd.gz.xz

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

==================================================================
BUG: KASAN: use-after-free in skb_update_prio net/core/dev.c:3906 [inline]
BUG: KASAN: use-after-free in __dev_queue_xmit+0x634/0x38d8 net/core/dev.c:4186
Read of size 8 at addr ffff000198d06ba0 by task aoe_tx0/2049

CPU: 1 PID: 2049 Comm: aoe_tx0 Not tainted 6.1.30-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x174/0x4c0 mm/kasan/report.c:395
kasan_report+0xd4/0x130 mm/kasan/report.c:495
__asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
skb_update_prio net/core/dev.c:3906 [inline]
__dev_queue_xmit+0x634/0x38d8 net/core/dev.c:4186
dev_queue_xmit include/linux/netdevice.h:3018 [inline]
tx+0x90/0x134 drivers/block/aoe/aoenet.c:63
kthread+0x1ac/0x374 drivers/block/aoe/aoecmd.c:1229
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860

Allocated by task 15974:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc_node+0xe0/0x1d0 mm/slab_common.c:962
kmalloc_node include/linux/slab.h:579 [inline]
kvmalloc_node+0x84/0x1e4 mm/util.c:581
kvmalloc include/linux/slab.h:706 [inline]
kvzalloc include/linux/slab.h:714 [inline]
alloc_netdev_mqs+0x94/0xba8 net/core/dev.c:10585
rtnl_create_link+0x2bc/0xa9c net/core/rtnetlink.c:3242
rtnl_newlink_create net/core/rtnetlink.c:3354 [inline]
__rtnl_newlink net/core/rtnetlink.c:3581 [inline]
rtnl_newlink+0x104c/0x1b04 net/core/rtnetlink.c:3594
rtnetlink_rcv_msg+0x72c/0xd94 net/core/rtnetlink.c:6091
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2524
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6109
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1902
sock_sendmsg_nosec net/socket.c:716 [inline]
sock_sendmsg net/socket.c:736 [inline]
____sys_sendmsg+0x558/0x844 net/socket.c:2482
___sys_sendmsg net/socket.c:2536 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2565
__do_sys_sendmsg net/socket.c:2574 [inline]
__se_sys_sendmsg net/socket.c:2572 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2572
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

Freed by task 15974:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516
____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x2c0/0x4b4 mm/slub.c:3674
kfree+0xcc/0x1b8 mm/slab_common.c:1007
kvfree+0x40/0x50 mm/util.c:627
netdev_freemem+0x4c/0x64 net/core/dev.c:10539
netdev_release+0x88/0xb0 net/core/net-sysfs.c:1910
device_release+0x8c/0x1ac
kobject_cleanup lib/kobject.c:681 [inline]
kobject_release lib/kobject.c:712 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x2a8/0x41c lib/kobject.c:729
netdev_run_todo+0xcf0/0xe08 net/core/dev.c:10375
rtnl_unlock net/core/rtnetlink.c:147 [inline]
rtnetlink_rcv_msg+0xa54/0xd94 net/core/rtnetlink.c:6092
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2524
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6109
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x834/0xb18 net/netlink/af_netlink.c:1902
sock_sendmsg_nosec net/socket.c:716 [inline]
sock_sendmsg net/socket.c:736 [inline]
____sys_sendmsg+0x558/0x844 net/socket.c:2482
___sys_sendmsg net/socket.c:2536 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2565
__do_sys_sendmsg net/socket.c:2574 [inline]
__se_sys_sendmsg net/socket.c:2572 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2572
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

The buggy address belongs to the object at ffff000198d06000
which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 2976 bytes inside of
4096-byte region [ffff000198d06000, ffff000198d07000)

The buggy address belongs to the physical page:
page:00000000a0c793a8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d8d00
head:00000000a0c793a8 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0003500
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff000198d06a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff000198d06b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff000198d06b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff000198d06c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff000198d06c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
selects TX queue 0, but real number of TX queues is 0


---
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.

syzbot

unread,
May 28, 2023, 1:42:18 PM5/28/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 1fe619a7d252 Linux 5.15.113
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15788815280000
kernel config: https://syzkaller.appspot.com/x/.config?x=8f10ee30ae29b021
dashboard link: https://syzkaller.appspot.com/bug?extid=34099a51622ebe1b7afc
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16581001280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11506435280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1b707a1e1816/disk-1fe619a7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/19cc598a8bbe/vmlinux-1fe619a7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a6cf7269bae5/Image-1fe619a7.gz.xz

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

==================================================================
BUG: KASAN: use-after-free in skb_update_prio net/core/dev.c:3900 [inline]
BUG: KASAN: use-after-free in __dev_queue_xmit+0x4b0/0x2a6c net/core/dev.c:4164
Read of size 8 at addr ffff00013cdc0be8 by task aoe_tx0/2046

CPU: 1 PID: 2046 Comm: aoe_tx0 Not tainted 5.15.113-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x174/0x1e4 mm/kasan/report.c:451
__asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309
skb_update_prio net/core/dev.c:3900 [inline]
__dev_queue_xmit+0x4b0/0x2a6c net/core/dev.c:4164
dev_queue_xmit+0x24/0x34 net/core/dev.c:4258
tx+0x8c/0x130 drivers/block/aoe/aoenet.c:63
kthread+0x1ac/0x374 drivers/block/aoe/aoecmd.c:1230
kthread+0x37c/0x45c kernel/kthread.c:319
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

Allocated by task 13041:
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+0xbc/0xfc mm/kasan/common.c:513
__kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522
kasan_kmalloc include/linux/kasan.h:264 [inline]
__kmalloc_node+0x2c0/0x5b8 mm/slub.c:4455
kmalloc_node include/linux/slab.h:614 [inline]
kvmalloc_node+0x88/0x204 mm/util.c:619
kvmalloc include/linux/mm.h:805 [inline]
kvzalloc include/linux/mm.h:813 [inline]
alloc_netdev_mqs+0x94/0x9d4 net/core/dev.c:10817
rtnl_create_link+0x2b8/0x86c net/core/rtnetlink.c:3185
__rtnl_newlink net/core/rtnetlink.c:3452 [inline]
rtnl_newlink+0xfa0/0x1ab8 net/core/rtnetlink.c:3510
rtnetlink_rcv_msg+0xa74/0xdac net/core/rtnetlink.c:5587
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2504
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5605
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1923
sock_sendmsg_nosec net/socket.c:704 [inline]
sock_sendmsg net/socket.c:724 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2412
___sys_sendmsg+0x214/0x294 net/socket.c:2466
__sys_sendmsg net/socket.c:2495 [inline]
__do_sys_sendmsg net/socket.c:2504 [inline]
__se_sys_sendmsg net/socket.c:2502 [inline]
__arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2502
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Freed by task 13041:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0x178/0x410 mm/slub.c:4559
kvfree+0x40/0x50 mm/util.c:654
netdev_freemem+0x4c/0x64 net/core/dev.c:10771
netdev_release+0x88/0xb0 net/core/net-sysfs.c:1903
device_release+0x8c/0x1ac
kobject_cleanup lib/kobject.c:713 [inline]
kobject_release lib/kobject.c:744 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x2c4/0x438 lib/kobject.c:761
netdev_run_todo+0x968/0xae0 net/core/dev.c:10635
rtnl_unlock net/core/rtnetlink.c:112 [inline]
rtnetlink_rcv_msg+0xa7c/0xdac net/core/rtnetlink.c:5588
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2504
rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5605
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1923
sock_sendmsg_nosec net/socket.c:704 [inline]
sock_sendmsg net/socket.c:724 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2412
___sys_sendmsg+0x214/0x294 net/socket.c:2466
__sys_sendmsg net/socket.c:2495 [inline]
__do_sys_sendmsg net/socket.c:2504 [inline]
__se_sys_sendmsg net/socket.c:2502 [inline]
__arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2502
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff00013cdc0000
which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 3048 bytes inside of
4096-byte region [ffff00013cdc0000, ffff00013cdc1000)
The buggy address belongs to the page:
page:0000000052816f06 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x17cdc0
head:0000000052816f06 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc0005156200 0000000300000003 ffff0000c0003500
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff00013cdc0a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff00013cdc0b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff00013cdc0b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff00013cdc0c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff00013cdc0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
selects TX queue 0, but real number of TX queues is 0
Unable to handle kernel paging request at virtual address 004f805a6000065e
Mem abort info:
ESR = 0x0000000096000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
[004f805a6000065e] address between user and kernel address ranges
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 2046 Comm: aoe_tx0 Tainted: G B 5.15.113-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __dev_queue_xmit+0x74c/0x2a6c net/core/dev.c:4189
lr : trace_net_dev_queue include/trace/events/net.h:143 [inline]
lr : __dev_queue_xmit+0x740/0x2a6c net/core/dev.c:4188
sp : ffff800022847a60
x29: ffff800022847c30 x28: dfff800000000000 x27: aa8002d3000032f1
x26: ffff000167314800 x25: 0000000000000000 x24: ffff00010ebd2c00
x23: ffff800022847b20 x22: ffff00016722e305 x21: ffff8000148dd310
x20: ffff00016722e280 x19: 0000000000000002 x18: 0000000000000201
x17: ff80800008335ea8 x16: ffff800011950fac x15: ffff800008335ea8
x14: 00000000ffffffff x13: ffffffffffffffff x12: 0000000000000000
x11: ff8080000fd8c49c x10: 0000000000000000 x9 : ffff80000fd8c49c
x8 : 1550005a6000065e x7 : 0000000000001250 x6 : 0000000000001218
x5 : ffff800022847178 x4 : ffff8000149a7538 x3 : ffff80000fd8c3c8
x2 : 0000000000000000 x1 : ffff800011f50840 x0 : 0000000000000001
Call trace:
__dev_queue_xmit+0x74c/0x2a6c net/core/dev.c:4189
dev_queue_xmit+0x24/0x34 net/core/dev.c:4258
tx+0x8c/0x130 drivers/block/aoe/aoenet.c:63
kthread+0x1ac/0x374 drivers/block/aoe/aoecmd.c:1230
kthread+0x37c/0x45c kernel/kthread.c:319
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870
Code: 961cdb19 14000002 961cdb17 d343ff68 (387c6908)
---[ end trace 5740fb67e385abe1 ]---
----------------
Code disassembly (best guess):
0: 961cdb19 bl 0xfffffffff8736c64
4: 14000002 b 0xc
8: 961cdb17 bl 0xfffffffff8736c64
c: d343ff68 lsr x8, x27, #3
* 10: 387c6908 ldrb w8, [x8, x28] <-- trapping instruction


---
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 bug is already fixed, 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.

Reply all
Reply to author
Forward
0 new messages