[moderation] [block?] KASAN: slab-use-after-free Read in netdev_core_pick_tx

10 views
Skip to first unread message

syzbot

unread,
Nov 3, 2023, 4:16:34 PM11/3/23
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8f6f76a6a29f Merge tag 'mm-nonmm-stable-2023-11-02-14-08' ..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=148d9a90e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=cc13ef1ed7e26f6c
dashboard link: https://syzkaller.appspot.com/bug?extid=1d61b3ead7c6781dc42a
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
CC: [ax...@kernel.dk jus...@coraid.com linux...@vger.kernel.org linux-...@vger.kernel.org]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/955fd21ef8a5/disk-8f6f76a6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0ea154b2a4e9/vmlinux-8f6f76a6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3d047221c12b/bzImage-8f6f76a6.xz

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

ieee802154 phy0 wpan0: encryption failed: -22
ieee802154 phy1 wpan1: encryption failed: -22
sl0 selects TX queue 0, but real number of TX queues is 0
==================================================================
BUG: KASAN: slab-use-after-free in netdev_get_tx_queue include/linux/netdevice.h:2519 [inline]
BUG: KASAN: slab-use-after-free in netdev_core_pick_tx+0x323/0x390 net/core/dev.c:4228
Read of size 4 at addr ffff88807ddba448 by task aoe_tx0/1223

CPU: 1 PID: 1223 Comm: aoe_tx0 Not tainted 6.6.0-syzkaller-12401-g8f6f76a6a29f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
netdev_get_tx_queue include/linux/netdevice.h:2519 [inline]
netdev_core_pick_tx+0x323/0x390 net/core/dev.c:4228
__dev_queue_xmit+0x71a/0x3d10 net/core/dev.c:4304
dev_queue_xmit include/linux/netdevice.h:3112 [inline]
tx+0x76/0x100 drivers/block/aoe/aoenet.c:62
kthread+0x1e9/0x3c0 drivers/block/aoe/aoecmd.c:1229
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
</TASK>

Allocated by task 8390:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:198 [inline]
__do_kmalloc_node mm/slab_common.c:1007 [inline]
__kmalloc_node+0x63/0x110 mm/slab_common.c:1014
kmalloc_node include/linux/slab.h:620 [inline]
kvmalloc_node+0x99/0x1a0 mm/util.c:607
kvmalloc include/linux/slab.h:738 [inline]
kvzalloc include/linux/slab.h:746 [inline]
alloc_netdev_mqs+0x9b/0x1290 net/core/dev.c:10726
sl_alloc drivers/net/slip/slip.c:756 [inline]
slip_open+0x35d/0x1130 drivers/net/slip/slip.c:817
tty_ldisc_open+0x98/0x100 drivers/tty/tty_ldisc.c:432
tty_set_ldisc+0x2e2/0x680 drivers/tty/tty_ldisc.c:557
tiocsetd drivers/tty/tty_io.c:2435 [inline]
tty_ioctl+0xbda/0x1580 drivers/tty/tty_io.c:2716
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b

Freed by task 8386:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
__kmem_cache_free+0xc0/0x180 mm/slub.c:3822
kvfree+0x47/0x50 mm/util.c:653
device_release+0xa1/0x240 drivers/base/core.c:2484
kobject_cleanup lib/kobject.c:682 [inline]
kobject_release lib/kobject.c:716 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x1d0/0x440 lib/kobject.c:733
netdev_run_todo+0x7e2/0x11d0 net/core/dev.c:10481
slip_close+0x165/0x1c0 drivers/net/slip/slip.c:906
tty_ldisc_close+0x111/0x190 drivers/tty/tty_ldisc.c:455
tty_ldisc_kill+0x8e/0x150 drivers/tty/tty_ldisc.c:607
tty_ldisc_release+0x116/0x2a0 drivers/tty/tty_ldisc.c:775
tty_release_struct+0x23/0xe0 drivers/tty/tty_io.c:1692
tty_release+0xe2c/0x1420 drivers/tty/tty_io.c:1863
__fput+0x270/0xbb0 fs/file_table.c:394
__fput_sync+0x47/0x50 fs/file_table.c:475
__do_sys_close fs/open.c:1590 [inline]
__se_sys_close fs/open.c:1575 [inline]
__x64_sys_close+0x87/0xf0 fs/open.c:1575
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b

The buggy address belongs to the object at ffff88807ddba000
which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 1096 bytes inside of
freed 4096-byte region [ffff88807ddba000, ffff88807ddbb000)

The buggy address belongs to the physical page:
page:ffffea0001f76e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7ddb8
head:ffffea0001f76e00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff888026dacb01
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff88801304f500 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000040004 00000001ffffffff ffff888026dacb01
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 4516, tgid 4516 (udevd), ts 273480871202, free_ts 273455171479
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537
prep_new_page mm/page_alloc.c:1544 [inline]
get_page_from_freelist+0xa25/0x36c0 mm/page_alloc.c:3312
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4568
alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133
alloc_slab_page mm/slub.c:1870 [inline]
allocate_slab+0x251/0x380 mm/slub.c:2017
new_slab mm/slub.c:2070 [inline]
___slab_alloc+0x8c7/0x1580 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
__kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node+0x52/0x110 mm/slab_common.c:1014
kmalloc_node include/linux/slab.h:620 [inline]
kvmalloc_node+0x99/0x1a0 mm/util.c:607
kvmalloc include/linux/slab.h:738 [inline]
seq_buf_alloc fs/seq_file.c:38 [inline]
seq_read_iter+0x80b/0x1280 fs/seq_file.c:210
kernfs_fop_read_iter+0x4c8/0x680 fs/kernfs/file.c:279
call_read_iter include/linux/fs.h:2014 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x4d4/0x8f0 fs/read_write.c:470
ksys_read+0x12f/0x250 fs/read_write.c:613
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1137 [inline]
free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2347
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487
__unfreeze_partials+0x21d/0x240 mm/slub.c:2655
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:763 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
slab_alloc mm/slub.c:3486 [inline]
__kmem_cache_alloc_lru mm/slub.c:3493 [inline]
kmem_cache_alloc+0x15d/0x380 mm/slub.c:3502
getname_flags.part.0+0x50/0x4e0 fs/namei.c:140
getname_flags+0x9c/0xf0 include/linux/audit.h:321
user_path_at_empty+0x2c/0x60 fs/namei.c:2910
do_readlinkat+0xdd/0x310 fs/stat.c:490
__do_sys_readlink fs/stat.c:523 [inline]
__se_sys_readlink fs/stat.c:520 [inline]
__x64_sys_readlink+0x78/0xb0 fs/stat.c:520
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b

Memory state around the buggy address:
ffff88807ddba300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807ddba380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807ddba400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807ddba480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807ddba500: 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

syzbot

unread,
Feb 1, 2024, 2:31:21 PMFeb 1
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages