syzbot


KASAN: use-after-free Read in __dev_queue_xmit

Status: upstream: reported C repro on 2023/04/29 13:33
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+4b8abd8f290c98754eee@syzkaller.appspotmail.com
First crash: 361d, last: 29d
Bug presence (1)
Date Name Commit Repro Result
2023/05/28 upstream (ToT) 7877cb91f108 C [report] BUG: MAX_LOCKDEP_CHAINS too low!
Similar bugs (10)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in __dev_queue_xmit C 46 1617d 1839d 0/3 public: reported C repro on 2019/04/13 00:00
upstream KASAN: use-after-free Read in __dev_queue_xmit (4) block 1 1369d 1369d 0/26 auto-closed as invalid on 2020/10/23 09:56
upstream KASAN: use-after-free Read in __dev_queue_xmit (5) block C unreliable error 49 54d 933d 0/26 upstream: reported C repro on 2021/10/04 21:37
upstream KASAN: use-after-free Read in __dev_queue_xmit (2) net C 2 2166d 2166d 5/26 fixed on 2018/06/07 13:52
upstream KASAN: use-after-free Read in __dev_queue_xmit (3) net 11 2033d 2036d 11/26 fixed on 2018/11/12 21:25
linux-5.15 KASAN: use-after-free Read in __dev_queue_xmit origin:upstream missing-backport C error 3 82d 332d 0/3 upstream: reported C repro on 2023/05/28 17:42
linux-4.19 KASAN: use-after-free Read in __dev_queue_xmit C error 15 419d 1091d 0/1 upstream: reported C repro on 2021/04/30 04:08
upstream KASAN: use-after-free Read in __dev_queue_xmit net C 10 2184d 2303d 5/26 fixed on 2018/05/09 07:47
linux-4.14 KASAN: use-after-free Read in __dev_queue_xmit C error 1 593d 805d 0/1 upstream: reported C repro on 2022/02/10 06:42
upstream BUG: unable to handle kernel paging request in __dev_queue_xmit block 1 1099d 1090d 0/26 auto-closed as invalid on 2021/06/21 04:04
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2024/03/26 16:12 2h14m bisect fix linux-6.1.y job log (0) log
2024/02/25 11:50 2h33m bisect fix linux-6.1.y job log (0) log
2024/01/17 19:49 2h30m bisect fix linux-6.1.y job log (0) log
2023/12/17 23:32 1h58m bisect fix linux-6.1.y job log (0) log
2023/11/17 16:58 2h06m bisect fix linux-6.1.y job log (0) log
2023/10/16 18:45 2h09m bisect fix linux-6.1.y job log (0) log
2023/09/11 10:44 2h46m bisect fix linux-6.1.y job log (0) log
2023/06/28 05:31 1h23m bisect fix linux-6.1.y job log (0) log

Sample crash report:
==================================================================
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

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/28 13:10 linux-6.1.y a343b0dd87b4 cf184559 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in __dev_queue_xmit
2023/04/29 13:32 linux-6.1.y ca1c9012c941 62df2017 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __dev_queue_xmit
* Struck through repros no longer work on HEAD.