syzbot


KASAN: use-after-free Read in __dev_queue_xmit

Status: public: reported C repro on 2019/04/13 00:00
Reported-by: syzbot+ecd9b80965b940128f2a@syzkaller.appspotmail.com
First crash: 2264d, last: 1696d
Similar bugs (9)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __dev_queue_xmit (4) block 1 1449d 1449d 0/27 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 133d 1013d 0/27 upstream: reported C repro on 2021/10/04 21:37
upstream KASAN: use-after-free Read in __dev_queue_xmit (2) net C 2 2246d 2246d 5/27 fixed on 2018/06/07 13:52
upstream KASAN: use-after-free Read in __dev_queue_xmit (3) net 11 2112d 2115d 11/27 fixed on 2018/11/12 21:25
linux-6.1 KASAN: use-after-free Read in __dev_queue_xmit origin:upstream C error 2 77d 441d 0/3 upstream: reported C repro on 2023/04/29 13:33
linux-5.15 KASAN: use-after-free Read in __dev_queue_xmit origin:upstream missing-backport C error 3 162d 412d 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 499d 1170d 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 2264d 2382d 5/27 fixed on 2018/05/09 07:47
linux-4.14 KASAN: use-after-free Read in __dev_queue_xmit C error 1 672d 884d 0/1 upstream: reported C repro on 2022/02/10 06:42

Sample crash report:
IPv6: ADDRCONF(NETDEV_UP): veth0: link is not ready
IPv6: ADDRCONF(NETDEV_UP): veth1: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
==================================================================
BUG: KASAN: use-after-free in qdisc_pkt_len_init net/core/dev.c:3085 [inline]
BUG: KASAN: use-after-free in __dev_queue_xmit+0x18fc/0x2080 net/core/dev.c:3395
Read of size 2 at addr ffff8801be0dd4c2 by task syz-executor852/3805

CPU: 1 PID: 3805 Comm: syz-executor852 Not tainted 4.9.101-gaef17a5 #29
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 ffff8801d96e7500 ffffffff81eb1009 ffffea0006f83700 ffff8801be0dd4c2
 0000000000000000 ffff8801be0dd4c2 ffff8801d769b0d0 ffff8801d96e7538
 ffffffff8156541b ffff8801be0dd4c2 0000000000000002 0000000000000000
Call Trace:
 [<ffffffff81eb1009>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81eb1009>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff8156541b>] print_address_description+0x6c/0x234 mm/kasan/report.c:256
 [<ffffffff81565825>] kasan_report_error mm/kasan/report.c:355 [inline]
 [<ffffffff81565825>] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412
 [<ffffffff81539464>] __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:431
 [<ffffffff83087b8c>] qdisc_pkt_len_init net/core/dev.c:3085 [inline]
 [<ffffffff83087b8c>] __dev_queue_xmit+0x18fc/0x2080 net/core/dev.c:3395
 [<ffffffff83088327>] dev_queue_xmit+0x17/0x20 net/core/dev.c:3484
 [<ffffffff8368dabf>] packet_snd net/packet/af_packet.c:2960 [inline]
 [<ffffffff8368dabf>] packet_sendmsg+0x1eff/0x4470 net/packet/af_packet.c:2985
 [<ffffffff83012fcc>] sock_sendmsg_nosec net/socket.c:635 [inline]
 [<ffffffff83012fcc>] sock_sendmsg+0xcc/0x110 net/socket.c:645
 [<ffffffff830147ea>] ___sys_sendmsg+0x47a/0x840 net/socket.c:1969
 [<ffffffff83016d41>] __sys_sendmmsg+0x161/0x3d0 net/socket.c:2059
 [<ffffffff83016fe5>] SYSC_sendmmsg net/socket.c:2090 [inline]
 [<ffffffff83016fe5>] SyS_sendmmsg+0x35/0x60 net/socket.c:2085
 [<ffffffff81006316>] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282
 [<ffffffff839f4893>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Allocated by task 3805:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack+0x43/0xd0 mm/kasan/kasan.c:505
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:609
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:547
 slab_post_alloc_hook mm/slab.h:417 [inline]
 slab_alloc_node mm/slub.c:2715 [inline]
 slab_alloc mm/slub.c:2723 [inline]
 __kmalloc_track_caller+0xdc/0x2b0 mm/slub.c:4232
 __kmalloc_reserve.isra.37+0x33/0xc0 net/core/skbuff.c:138
 __alloc_skb+0x11a/0x600 net/core/skbuff.c:231
 alloc_skb include/linux/skbuff.h:919 [inline]
 alloc_skb_with_frags+0xaf/0x520 net/core/skbuff.c:4679
 sock_alloc_send_pskb+0x5a9/0x750 net/core/sock.c:1893
 packet_alloc_skb net/packet/af_packet.c:2817 [inline]
 packet_snd net/packet/af_packet.c:2908 [inline]
 packet_sendmsg+0x1581/0x4470 net/packet/af_packet.c:2985
 sock_sendmsg_nosec net/socket.c:635 [inline]
 sock_sendmsg+0xcc/0x110 net/socket.c:645
 ___sys_sendmsg+0x47a/0x840 net/socket.c:1969
 __sys_sendmmsg+0x161/0x3d0 net/socket.c:2059
 SYSC_sendmmsg net/socket.c:2090 [inline]
 SyS_sendmmsg+0x35/0x60 net/socket.c:2085
 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Freed by task 3805:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack+0x43/0xd0 mm/kasan/kasan.c:505
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:582
 slab_free_hook mm/slub.c:1355 [inline]
 slab_free_freelist_hook mm/slub.c:1377 [inline]
 slab_free mm/slub.c:2958 [inline]
 kfree+0xfb/0x310 mm/slub.c:3878
 skb_free_head+0x8b/0xb0 net/core/skbuff.c:580
 skb_release_data+0x329/0x400 net/core/skbuff.c:611
 skb_release_all+0x4a/0x60 net/core/skbuff.c:670
 __kfree_skb+0x15/0x20 net/core/skbuff.c:684
 kfree_skb+0xcc/0x340 net/core/skbuff.c:705
 __skb_complete_tx_timestamp+0x2ba/0x3a0 net/core/skbuff.c:3824
 __skb_tstamp_tx+0x19a/0x4b0 net/core/skbuff.c:3896
 __dev_queue_xmit+0x130f/0x2080 net/core/dev.c:3386
 dev_queue_xmit+0x17/0x20 net/core/dev.c:3484
 packet_snd net/packet/af_packet.c:2960 [inline]
 packet_sendmsg+0x1eff/0x4470 net/packet/af_packet.c:2985
 sock_sendmsg_nosec net/socket.c:635 [inline]
 sock_sendmsg+0xcc/0x110 net/socket.c:645
 ___sys_sendmsg+0x47a/0x840 net/socket.c:1969
 __sys_sendmmsg+0x161/0x3d0 net/socket.c:2059
 SYSC_sendmmsg net/socket.c:2090 [inline]
 SyS_sendmmsg+0x35/0x60 net/socket.c:2085
 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282
 entry_SYSCALL_64_after_swapgs+0x5d/0xdb

The buggy address belongs to the object at ffff8801be0dd400
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 194 bytes inside of
 512-byte region [ffff8801be0dd400, ffff8801be0dd600)
The buggy address belongs to the page:
page:ffffea0006f83700 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x8000000000004080(slab|head)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801be0dd380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801be0dd400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801be0dd480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff8801be0dd500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801be0dd580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (46):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/05/20 22:05 https://android.googlesource.com/kernel/common android-4.9 aef17a58e8ca f48c20b8 .config console log report syz C ci-android-49-kasan-gce-root
2018/05/02 10:47 https://android.googlesource.com/kernel/common android-4.9 1321d4226176 d5b114b4 .config console log report syz C ci-android-49-kasan-gce-root
2019/11/21 05:10 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 8098ea0f .config console log report ci-android-49-kasan-gce
2019/11/19 13:33 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 5bc70212 .config console log report ci-android-49-kasan-gce
2019/11/16 05:56 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 cdac920b .config console log report ci-android-49-kasan-gce-root
2018/05/24 11:00 https://android.googlesource.com/kernel/common android-4.9 c5aceac71b68 f48c20b8 .config console log report ci-android-49-kasan-gce-root
2018/05/23 18:14 https://android.googlesource.com/kernel/common android-4.9 d054505522c4 f48c20b8 .config console log report ci-android-49-kasan-gce-root
2018/05/22 00:10 https://android.googlesource.com/kernel/common android-4.9 aef17a58e8ca f48c20b8 .config console log report ci-android-49-kasan-gce-root
2018/05/21 18:55 https://android.googlesource.com/kernel/common android-4.9 aef17a58e8ca f48c20b8 .config console log report ci-android-49-kasan-gce-root
2018/05/18 22:18 https://android.googlesource.com/kernel/common android-4.9 e14d1a35ebd9 849705db .config console log report ci-android-49-kasan-gce-root
2018/05/18 14:37 https://android.googlesource.com/kernel/common android-4.9 73fdfa38c59d c992b767 .config console log report ci-android-49-kasan-gce-root
2018/05/18 08:57 https://android.googlesource.com/kernel/common android-4.9 73fdfa38c59d c992b767 .config console log report ci-android-49-kasan-gce-root
2018/05/16 21:47 https://android.googlesource.com/kernel/common android-4.9 73fdfa38c59d a367c1d7 .config console log report ci-android-49-kasan-gce-root
2018/05/16 16:12 https://android.googlesource.com/kernel/common android-4.9 39c856663dcc 75b2448a .config console log report ci-android-49-kasan-gce-root
2018/05/16 04:38 https://android.googlesource.com/kernel/common android-4.9 74fa0af47306 68ce85f1 .config console log report ci-android-49-kasan-gce-root
2018/05/16 02:16 https://android.googlesource.com/kernel/common android-4.9 74fa0af47306 68ce85f1 .config console log report ci-android-49-kasan-gce-root
2018/05/15 16:38 https://android.googlesource.com/kernel/common android-4.9 74fa0af47306 661fd7b9 .config console log report ci-android-49-kasan-gce-root
2018/05/14 21:50 https://android.googlesource.com/kernel/common android-4.9 74fa0af47306 d2284dda .config console log report ci-android-49-kasan-gce-root
2018/05/14 20:55 https://android.googlesource.com/kernel/common android-4.9 74fa0af47306 d2284dda .config console log report ci-android-49-kasan-gce-root
2018/05/14 07:57 https://android.googlesource.com/kernel/common android-4.9 c2f9bce9fee8 481f030c .config console log report ci-android-49-kasan-gce-root
2018/05/14 04:06 https://android.googlesource.com/kernel/common android-4.9 c2f9bce9fee8 481f030c .config console log report ci-android-49-kasan-gce-root
2018/05/13 05:56 https://android.googlesource.com/kernel/common android-4.9 c2f9bce9fee8 e726f42b .config console log report ci-android-49-kasan-gce-root
2018/05/13 02:37 https://android.googlesource.com/kernel/common android-4.9 c2f9bce9fee8 e726f42b .config console log report ci-android-49-kasan-gce-root
2018/05/12 20:03 https://android.googlesource.com/kernel/common android-4.9 c2f9bce9fee8 e726f42b .config console log report ci-android-49-kasan-gce-root
2018/05/12 11:03 https://android.googlesource.com/kernel/common android-4.9 c2f9bce9fee8 e726f42b .config console log report ci-android-49-kasan-gce-root
2018/05/11 22:35 https://android.googlesource.com/kernel/common android-4.9 c2f9bce9fee8 12c7428a .config console log report ci-android-49-kasan-gce-root
2018/05/11 14:35 https://android.googlesource.com/kernel/common android-4.9 c462abbf779b 12c7428a .config console log report ci-android-49-kasan-gce-root
2018/05/11 09:20 https://android.googlesource.com/kernel/common android-4.9 c462abbf779b 12c7428a .config console log report ci-android-49-kasan-gce-root
2018/05/10 07:37 https://android.googlesource.com/kernel/common android-4.9 c462abbf779b 12c7428a .config console log report ci-android-49-kasan-gce-root
2018/05/10 03:40 https://android.googlesource.com/kernel/common android-4.9 c462abbf779b 12c7428a .config console log report ci-android-49-kasan-gce-root
2018/05/09 23:49 https://android.googlesource.com/kernel/common android-4.9 c462abbf779b 12c7428a .config console log report ci-android-49-kasan-gce-root
2018/05/09 04:54 https://android.googlesource.com/kernel/common android-4.9 9731a2dab47e b88872ba .config console log report ci-android-49-kasan-gce-root
2018/05/09 00:42 https://android.googlesource.com/kernel/common android-4.9 9731a2dab47e b88872ba .config console log report ci-android-49-kasan-gce-root
2018/05/08 14:14 https://android.googlesource.com/kernel/common android-4.9 a03d0bbacd41 045bbd4a .config console log report ci-android-49-kasan-gce-root
2018/05/07 03:43 https://android.googlesource.com/kernel/common android-4.9 63a812bb84e4 a211da1a .config console log report ci-android-49-kasan-gce-root
2018/05/07 03:26 https://android.googlesource.com/kernel/common android-4.9 63a812bb84e4 a211da1a .config console log report ci-android-49-kasan-gce-root
2018/05/06 17:20 https://android.googlesource.com/kernel/common android-4.9 63a812bb84e4 6c18ddb0 .config console log report ci-android-49-kasan-gce-root
2018/05/06 14:33 https://android.googlesource.com/kernel/common android-4.9 63a812bb84e4 6c18ddb0 .config console log report ci-android-49-kasan-gce-root
2018/05/04 23:38 https://android.googlesource.com/kernel/common android-4.9 f5a861c30cb7 9ce14f4b .config console log report ci-android-49-kasan-gce-root
2018/05/04 16:09 https://android.googlesource.com/kernel/common android-4.9 0e25e2cab07a 9ce14f4b .config console log report ci-android-49-kasan-gce-root
2018/05/04 12:44 https://android.googlesource.com/kernel/common android-4.9 0e25e2cab07a 9ce14f4b .config console log report ci-android-49-kasan-gce-root
2018/05/03 20:25 https://android.googlesource.com/kernel/common android-4.9 f679e4d9b77a 9ce14f4b .config console log report ci-android-49-kasan-gce-root
2018/05/03 18:43 https://android.googlesource.com/kernel/common android-4.9 f679e4d9b77a 9ce14f4b .config console log report ci-android-49-kasan-gce-root
2018/05/03 15:07 https://android.googlesource.com/kernel/common android-4.9 f679e4d9b77a 9ce14f4b .config console log report ci-android-49-kasan-gce-root
2018/05/03 11:59 https://android.googlesource.com/kernel/common android-4.9 f679e4d9b77a 9ce14f4b .config console log report ci-android-49-kasan-gce-root
2018/05/02 09:54 https://android.googlesource.com/kernel/common android-4.9 1321d4226176 d5b114b4 .config console log report ci-android-49-kasan-gce-root
* Struck through repros no longer work on HEAD.