syzbot


KASAN: use-after-free Read in __dev_queue_xmit

Status: upstream: reported C repro on 2023/05/28 17:42
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+34099a51622ebe1b7afc@syzkaller.appspotmail.com
First crash: 325d, last: 75d
Fix bisection: failed (error log, bisect log)
  
Bug presence (3)
Date Name Commit Repro Result
2024/01/12 linux-5.15.y (ToT) 26c690eff0a5 C [report] BUG: MAX_LOCKDEP_CHAINS too low!
2023/05/28 upstream (ToT) 7877cb91f108 C [report] BUG: MAX_LOCKDEP_CHAINS too low!
2024/01/12 upstream (ToT) 70d201a40823 C Didn't crash
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 1610d 1832d 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 1362d 1362d 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 47d 926d 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 2159d 2159d 5/26 fixed on 2018/06/07 13:52
upstream KASAN: use-after-free Read in __dev_queue_xmit (3) net 11 2025d 2029d 11/26 fixed on 2018/11/12 21:25
linux-6.1 KASAN: use-after-free Read in __dev_queue_xmit origin:upstream C 2 22d 354d 0/3 upstream: reported C repro on 2023/04/29 13:33
linux-4.19 KASAN: use-after-free Read in __dev_queue_xmit C error 15 412d 1084d 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 2177d 2296d 5/26 fixed on 2018/05/09 07:47
linux-4.14 KASAN: use-after-free Read in __dev_queue_xmit C error 1 586d 798d 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 1092d 1083d 0/26 auto-closed as invalid on 2021/06/21 04:04
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/03/25 09:55 0m fix candidate upstream error job log (0)
2024/01/21 22:20 0m fix candidate upstream error job log (0)
2023/06/28 22:20 0m bisect fix linux-5.15.y error job log (0)

Sample crash report:
aoe: packet could not be sent on bond1.  consider increasing tx_queue_len
bridge2600 selects TX queue 0, but real number of TX queues is 0
==================================================================
BUG: KASAN: use-after-free in __dev_queue_xmit+0x66c/0x2a6c net/core/dev.c:4206
Read of size 8 at addr ffff000110ca1c08 by task aoe_tx0/2048

CPU: 1 PID: 2048 Comm: aoe_tx0 Not tainted 5.15.144-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/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
 __dev_queue_xmit+0x66c/0x2a6c net/core/dev.c:4206
 dev_queue_xmit+0x24/0x34 net/core/dev.c:4278
 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 10747:
 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]
 netif_alloc_netdev_queues net/core/dev.c:10206 [inline]
 alloc_netdev_mqs+0x4b8/0x9d4 net/core/dev.c:10892
 rtnl_create_link+0x2cc/0x8b4 net/core/rtnetlink.c:3206
 __rtnl_newlink net/core/rtnetlink.c:3491 [inline]
 rtnl_newlink+0xffc/0x1af4 net/core/rtnetlink.c:3549
 rtnetlink_rcv_msg+0xa74/0xdac net/core/rtnetlink.c:5630
 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2505
 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5648
 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:1924
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x584/0x870 net/socket.c:2429
 ___sys_sendmsg+0x214/0x294 net/socket.c:2483
 __sys_sendmsg net/socket.c:2512 [inline]
 __do_sys_sendmsg net/socket.c:2521 [inline]
 __se_sys_sendmsg net/socket.c:2519 [inline]
 __arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2519
 __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:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Freed by task 10747:
 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
 netif_free_tx_queues net/core/dev.c:10194 [inline]
 free_netdev+0xa4/0x3e8 net/core/dev.c:10949
 netdev_run_todo+0x900/0xae0 net/core/dev.c:10646
 rtnl_unlock net/core/rtnetlink.c:112 [inline]
 rtnetlink_rcv_msg+0xa7c/0xdac net/core/rtnetlink.c:5631
 netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2505
 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5648
 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:1924
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x584/0x870 net/socket.c:2429
 ___sys_sendmsg+0x214/0x294 net/socket.c:2483
 __sys_sendmsg net/socket.c:2512 [inline]
 __do_sys_sendmsg net/socket.c:2521 [inline]
 __se_sys_sendmsg net/socket.c:2519 [inline]
 __arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2519
 __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:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff000110ca1c00
 which belongs to the cache kmalloc-cg-512 of size 512
The buggy address is located 8 bytes inside of
 512-byte region [ffff000110ca1c00, ffff000110ca1e00)
The buggy address belongs to the page:
page:0000000093057602 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x150ca0
head:0000000093057602 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 0000000100000001 ffff0000c0003080
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff000110ca1b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff000110ca1b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff000110ca1c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff000110ca1c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff000110ca1d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address f1bb80500000053f
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
[f1bb80500000053f] address between user and kernel address ranges
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 2048 Comm: aoe_tx0 Tainted: G    B             5.15.144-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __dev_queue_xmit+0x74c/0x2a6c net/core/dev.c:4209
lr : trace_net_dev_queue include/trace/events/net.h:143 [inline]
lr : __dev_queue_xmit+0x740/0x2a6c net/core/dev.c:4208
sp : ffff800022617a60
x29: ffff800022617c30 x28: dfff800000000000 x27: 8de00280000029fb
x26: ffff000148421800 x25: 0000000000000000 x24: ffff000110ca1c00
x23: ffff800022617b20 x22: ffff0001482dbbc5 x21: ffff80001490d310
x20: ffff0001482dbb40 x19: 0000000000000002 x18: 0000000000000202
x17: 0000000000000000 x16: ffff800011977b6c x15: 00000000ffffffff
x14: ffff0000ce909b40 x13: 0000000000000001 x12: ffff700002de2764
x11: 0000000000000200 x10: 0000000000000000 x9 : ffff0000ce909b40
x8 : 11bc00500000053f x7 : 0000000000000000 x6 : 0000000000000001
x5 : ffff8000226170f8 x4 : 0000000000000000 x3 : ffff80000819b844
x2 : 0000000000000001 x1 : ffff800011f71400 x0 : 0000000000000001
Call trace:
 __dev_queue_xmit+0x74c/0x2a6c net/core/dev.c:4209
 dev_queue_xmit+0x24/0x34 net/core/dev.c:4278
 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: 961c5f1c 14000002 961c5f1a d343ff68 (387c6908) 
---[ end trace 25fa8628af1b8c2f ]---
----------------
Code disassembly (best guess):
   0:	961c5f1c 	bl	0xfffffffff8717c70
   4:	14000002 	b	0xc
   8:	961c5f1a 	bl	0xfffffffff8717c70
   c:	d343ff68 	lsr	x8, x27, #3
* 10:	387c6908 	ldrb	w8, [x8, x28] <-- trapping instruction

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/22 01:22 linux-5.15.y 1d146b1875fc 4f9530a3 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in __dev_queue_xmit
2023/05/28 17:40 linux-5.15.y 1fe619a7d252 cf184559 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in __dev_queue_xmit
2024/02/02 22:34 linux-5.15.y 6139f2a02fe0 60bf9982 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in __dev_queue_xmit
* Struck through repros no longer work on HEAD.