syzbot


KASAN: use-after-free Read in do_xdp_generic

Status: auto-closed as invalid on 2020/05/18 09:26
Reported-by: syzbot+cc4c4c13fdec936154bc@syzkaller.appspotmail.com
First crash: 1646d, last: 1616d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in is_multicast_ether_addr_64bits include/linux/etherdevice.h:136 [inline]
BUG: KASAN: use-after-free in netif_receive_generic_xdp net/core/dev.c:4294 [inline]
BUG: KASAN: use-after-free in do_xdp_generic+0x612/0x1500 net/core/dev.c:4392
Read of size 8 at addr ffff8880a06bafff by task syz-executor.3/26937

CPU: 0 PID: 26937 Comm: syz-executor.3 Not tainted 5.4.19-syzkaller-00496-gf0212822faa9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1b0/0x228 lib/dump_stack.c:118
 print_address_description+0x96/0x5d0 mm/kasan/report.c:374
 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506
 kasan_report+0x26/0x50 mm/kasan/common.c:634
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 is_multicast_ether_addr_64bits include/linux/etherdevice.h:136 [inline]
 netif_receive_generic_xdp net/core/dev.c:4294 [inline]
 do_xdp_generic+0x612/0x1500 net/core/dev.c:4392
 tun_get_user+0x2498/0x3d10 drivers/net/tun.c:1935
 tun_chr_write_iter+0x134/0x1c0 drivers/net/tun.c:2026
 do_iter_readv_writev+0x5fa/0x890 include/linux/fs.h:1909
 do_iter_write+0x180/0x590 fs/read_write.c:973
 vfs_writev fs/read_write.c:1018 [inline]
 do_writev+0x2cd/0x560 fs/read_write.c:1061
 __do_sys_writev fs/read_write.c:1134 [inline]
 __se_sys_writev fs/read_write.c:1131 [inline]
 __x64_sys_writev+0x7d/0x90 fs/read_write.c:1131
 do_syscall_64+0xc0/0x100 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45c571
Code: 75 14 b8 14 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 e4 b7 fb ff c3 48 83 ec 08 e8 fa 2c 00 00 48 89 04 24 b8 14 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 43 2d 00 00 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007f4013825ba0 EFLAGS: 00000293 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 0000000020000179 RCX: 000000000045c571
RDX: 0000000000000001 RSI: 00007f4013825c00 RDI: 00000000000000f0
RBP: 000000000076bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000293 R12: 00000000ffffffff
R13: 0000000000000b81 R14: 00000000004cd93f R15: 000000000076bf2c

The buggy address belongs to the page:
page:ffffea000281ae80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
raw: 4000000000000000 ffffea000281ae88 ffffea000281ae88 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a06bae80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880a06baf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880a06baf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                                ^
 ffff8880a06bb000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880a06bb080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
------------[ cut here ]------------
Illegal XDP return value 4294967274, expect packet loss!
WARNING: CPU: 0 PID: 26937 at net/core/filter.c:6907 bpf_warn_invalid_xdp_action+0x5a/0x60 net/core/filter.c:6905
Modules linked in:
CPU: 0 PID: 26937 Comm: syz-executor.3 Tainted: G    B             5.4.19-syzkaller-00496-gf0212822faa9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:bpf_warn_invalid_xdp_action+0x5a/0x60 net/core/filter.c:6905
Code: e8 db 7b 5e fe 83 fb 04 48 c7 c0 6b 6e 56 84 48 c7 c6 73 6e 56 84 48 0f 47 f0 48 c7 c7 3e 6e 56 84 89 da 31 c0 e8 76 51 35 fe <0f> 0b eb bc 66 90 55 48 89 e5 41 57 41 56 41 55 41 54 53 50 4c 89
RSP: 0018:ffff88819ee2f668 EFLAGS: 00010246
RAX: 0413093d1f1a1b00 RBX: 00000000ffffffea RCX: 0000000000040000
RDX: ffffc9000416c000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffff88819ee2f670 R08: ffffffff812d0560 R09: ffffed103b743e92
R10: ffffed103b743e92 R11: 0000000000000000 R12: dffffc0000000000
R13: 00000000ffffffea R14: dffffc0000000000 R15: ffff8881ae00a280
FS:  00007f4013826700(0000) GS:ffff8881dba00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200000c0 CR3: 0000000198938004 CR4: 00000000001606f0
DR0: 0000000020000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
 netif_receive_generic_xdp net/core/dev.c:4343 [inline]
 do_xdp_generic+0xd2d/0x1500 net/core/dev.c:4392
 tun_get_user+0x2498/0x3d10 drivers/net/tun.c:1935
 tun_chr_write_iter+0x134/0x1c0 drivers/net/tun.c:2026
 do_iter_readv_writev+0x5fa/0x890 include/linux/fs.h:1909
 do_iter_write+0x180/0x590 fs/read_write.c:973
 vfs_writev fs/read_write.c:1018 [inline]
 do_writev+0x2cd/0x560 fs/read_write.c:1061
 __do_sys_writev fs/read_write.c:1134 [inline]
 __se_sys_writev fs/read_write.c:1131 [inline]
 __x64_sys_writev+0x7d/0x90 fs/read_write.c:1131
 do_syscall_64+0xc0/0x100 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45c571
Code: 75 14 b8 14 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 e4 b7 fb ff c3 48 83 ec 08 e8 fa 2c 00 00 48 89 04 24 b8 14 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 43 2d 00 00 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007f4013825ba0 EFLAGS: 00000293 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 0000000020000179 RCX: 000000000045c571
RDX: 0000000000000001 RSI: 00007f4013825c00 RDI: 00000000000000f0
RBP: 000000000076bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000293 R12: 00000000ffffffff
R13: 0000000000000b81 R14: 00000000004cd93f R15: 000000000076bf2c
---[ end trace 27613c6653372e8b ]---
BUG: unable to handle page fault for address: ffffed101b574cff
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 21fff7067 P4D 21fff7067 PUD 21fff6067 PMD 0 
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 26937 Comm: syz-executor.3 Tainted: G    B   W         5.4.19-syzkaller-00496-gf0212822faa9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:is_multicast_ether_addr_64bits include/linux/etherdevice.h:136 [inline]
RIP: 0010:netif_receive_generic_xdp net/core/dev.c:4294 [inline]
RIP: 0010:do_xdp_generic+0x603/0x1500 net/core/dev.c:4392
Code: 00 00 00 00 fc ff df 42 80 3c 30 00 74 05 e8 f4 e4 95 fe 4c 89 a4 24 d8 00 00 00 4c 89 ac 24 18 01 00 00 4c 89 f8 48 c1 e8 03 <42> 80 3c 30 00 74 08 4c 89 ff e8 2e e4 95 fe 49 8b 37 83 e6 01 31
RSP: 0018:ffff88819ee2f680 EFLAGS: 00010a07
RAX: 1ffff1101b574cff RBX: ffff88819ee2f788 RCX: 1ffff11033dc5ef1
RDX: ffff88818274c074 RSI: 00000000000000cb RDI: ffff88819ee2f798
RBP: ffff88819ee2f830 R08: ffffffff82db065b R09: ffffed103b572d5d
R10: ffffed103b572d5d R11: 0000000000000000 R12: ffff8880dab969b9
R13: ffff8881dab96800 R14: dffffc0000000000 R15: ffff8880daba67ff
FS:  00007f4013826700(0000) GS:ffff8881dbb00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffed101b574cff CR3: 0000000198938004 CR4: 00000000001606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 tun_get_user+0x2498/0x3d10 drivers/net/tun.c:1935
 tun_chr_write_iter+0x134/0x1c0 drivers/net/tun.c:2026
 do_iter_readv_writev+0x5fa/0x890 include/linux/fs.h:1909
 do_iter_write+0x180/0x590 fs/read_write.c:973
 vfs_writev fs/read_write.c:1018 [inline]
 do_writev+0x2cd/0x560 fs/read_write.c:1061
 __do_sys_writev fs/read_write.c:1134 [inline]
 __se_sys_writev fs/read_write.c:1131 [inline]
 __x64_sys_writev+0x7d/0x90 fs/read_write.c:1131
 do_syscall_64+0xc0/0x100 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45c571
Code: 75 14 b8 14 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 e4 b7 fb ff c3 48 83 ec 08 e8 fa 2c 00 00 48 89 04 24 b8 14 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 43 2d 00 00 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007f4013825ba0 EFLAGS: 00000293 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 0000000020000179 RCX: 000000000045c571
RDX: 0000000000000001 RSI: 00007f4013825c00 RDI: 00000000000000f0
RBP: 000000000076bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 00000000ffffffff
R13: 0000000000000b81 R14: 00000000004cd93f R15: 000000000076bf2c
Modules linked in:
CR2: ffffed101b574cff
---[ end trace 27613c6653372e8c ]---
RIP: 0010:is_multicast_ether_addr_64bits include/linux/etherdevice.h:136 [inline]
RIP: 0010:netif_receive_generic_xdp net/core/dev.c:4294 [inline]
RIP: 0010:do_xdp_generic+0x603/0x1500 net/core/dev.c:4392
Code: 00 00 00 00 fc ff df 42 80 3c 30 00 74 05 e8 f4 e4 95 fe 4c 89 a4 24 d8 00 00 00 4c 89 ac 24 18 01 00 00 4c 89 f8 48 c1 e8 03 <42> 80 3c 30 00 74 08 4c 89 ff e8 2e e4 95 fe 49 8b 37 83 e6 01 31
RSP: 0018:ffff88819ee2f680 EFLAGS: 00010a07
RAX: 1ffff1101b574cff RBX: ffff88819ee2f788 RCX: 1ffff11033dc5ef1
RDX: ffff88818274c074 RSI: 00000000000000cb RDI: ffff88819ee2f798
RBP: ffff88819ee2f830 R08: ffffffff82db065b R09: ffffed103b572d5d
R10: ffffed103b572d5d R11: 0000000000000000 R12: ffff8880dab969b9
R13: ffff8881dab96800 R14: dffffc0000000000 R15: ffff8880daba67ff
FS:  00007f4013826700(0000) GS:ffff8881dbb00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffed101b574cff CR3: 0000000198938004 CR4: 00000000001606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (198):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/02/18 09:25 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 1ce142dc .config console log report ci2-android-5-4-kasan
2020/02/18 07:55 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 1ce142dc .config console log report ci2-android-5-4-kasan
2020/02/18 01:13 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 1ce142dc .config console log report ci2-android-5-4-kasan
2020/02/17 20:54 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 72bfa6f2 .config console log report ci2-android-5-4-kasan
2020/02/17 19:32 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 72bfa6f2 .config console log report ci2-android-5-4-kasan
2020/02/17 12:48 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 72bfa6f2 .config console log report ci2-android-5-4-kasan
2020/02/17 09:50 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 1f448cd6 .config console log report ci2-android-5-4-kasan
2020/02/16 18:17 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 cf914200 .config console log report ci2-android-5-4-kasan
2020/02/16 14:32 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 cf914200 .config console log report ci2-android-5-4-kasan
2020/02/16 08:01 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/16 06:35 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/16 04:45 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/16 03:29 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/15 22:31 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/15 20:34 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/15 19:15 https://android.googlesource.com/kernel/common android-5.4 f0212822faa9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/15 10:15 https://android.googlesource.com/kernel/common android-5.4 f7d5a6d230b5 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/15 04:06 https://android.googlesource.com/kernel/common android-5.4 f7d5a6d230b5 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/14 19:16 https://android.googlesource.com/kernel/common android-5.4 f7d5a6d230b5 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/14 17:12 https://android.googlesource.com/kernel/common android-5.4 6387e43186c9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/14 10:44 https://android.googlesource.com/kernel/common android-5.4 6387e43186c9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/14 01:24 https://android.googlesource.com/kernel/common android-5.4 6387e43186c9 5d7b90f1 .config console log report ci2-android-5-4-kasan
2020/02/13 21:10 https://android.googlesource.com/kernel/common android-5.4 a6e4656398da e6247653 .config console log report ci2-android-5-4-kasan
2020/02/13 20:02 https://android.googlesource.com/kernel/common android-5.4 a6e4656398da e6247653 .config console log report ci2-android-5-4-kasan
2020/02/13 07:31 https://android.googlesource.com/kernel/common android-5.4 a6e4656398da 84f4fc8a .config console log report ci2-android-5-4-kasan
2020/02/13 04:09 https://android.googlesource.com/kernel/common android-5.4 eefb13c9f286 84f4fc8a .config console log report ci2-android-5-4-kasan
2020/02/12 18:10 https://android.googlesource.com/kernel/common android-5.4 eefb13c9f286 84f4fc8a .config console log report ci2-android-5-4-kasan
2020/02/12 14:14 https://android.googlesource.com/kernel/common android-5.4 ecf5064346c1 a75b198c .config console log report ci2-android-5-4-kasan
2020/02/12 05:51 https://android.googlesource.com/kernel/common android-5.4 ecf5064346c1 a75b198c .config console log report ci2-android-5-4-kasan
2020/02/11 17:19 https://android.googlesource.com/kernel/common android-5.4 0dba8e724663 4d1ab643 .config console log report ci2-android-5-4-kasan
2020/02/11 09:43 https://android.googlesource.com/kernel/common android-5.4 0dba8e724663 084454ae .config console log report ci2-android-5-4-kasan
2020/02/11 07:31 https://android.googlesource.com/kernel/common android-5.4 0dba8e724663 084454ae .config console log report ci2-android-5-4-kasan
2020/02/10 17:46 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 18847f55 .config console log report ci2-android-5-4-kasan
2020/02/10 16:06 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 18847f55 .config console log report ci2-android-5-4-kasan
2020/02/10 16:02 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 18847f55 .config console log report ci2-android-5-4-kasan
2020/02/10 14:08 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 35f5e45e .config console log report ci2-android-5-4-kasan
2020/02/10 10:08 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 35f5e45e .config console log report ci2-android-5-4-kasan
2020/02/10 08:56 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 35f5e45e .config console log report ci2-android-5-4-kasan
2020/02/10 07:03 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 35f5e45e .config console log report ci2-android-5-4-kasan
2020/02/10 05:54 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 35f5e45e .config console log report ci2-android-5-4-kasan
2020/02/10 04:38 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 35f5e45e .config console log report ci2-android-5-4-kasan
2020/02/09 22:10 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 35f5e45e .config console log report ci2-android-5-4-kasan
2020/02/09 20:58 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 6ece2ea5 .config console log report ci2-android-5-4-kasan
2020/02/09 19:52 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 6ece2ea5 .config console log report ci2-android-5-4-kasan
2020/02/09 18:04 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 6ece2ea5 .config console log report ci2-android-5-4-kasan
2020/02/09 09:53 https://android.googlesource.com/kernel/common android-5.4 9204f620c2a9 6ece2ea5 .config console log report ci2-android-5-4-kasan
2020/01/19 08:10 https://android.googlesource.com/kernel/common android-5.4 b0b02162a4b8 bc8bc756 .config console log report ci2-android-5-4-kasan
* Struck through repros no longer work on HEAD.