syzbot


KASAN: use-after-free Read in eth_header_parse_protocol

Status: fixed on 2021/10/12 13:38
Reported-by: syzbot+510189dc04dd72bb90fb@syzkaller.appspotmail.com
Fix commit: 599200ad44e7 net: ensure mac header is set in virtio_net_hdr_to_skb()
First crash: 509d, last: 479d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in eth_header_parse_protocol C done 1453 470d 516d 22/23 fixed on 2021/11/10 00:50

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in eth_header_parse_protocol+0xad/0xd0 net/ethernet/eth.c:282
Read of size 2 at addr ffff8881e8be800b by task syz-executor361/345

CPU: 0 PID: 345 Comm: syz-executor361 Not tainted 5.4.110-syzkaller-00108-g2c6775a89bc1 #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+0x1d8/0x24e lib/dump_stack.c:118
 print_address_description+0x9b/0x650 mm/kasan/report.c:384
 __kasan_report+0x182/0x260 mm/kasan/report.c:516
 kasan_report+0x30/0x60 mm/kasan/common.c:641
 eth_header_parse_protocol+0xad/0xd0 net/ethernet/eth.c:282
 dev_parse_header_protocol include/linux/netdevice.h:2984 [inline]
 virtio_net_hdr_to_skb+0x6de/0xd70 include/linux/virtio_net.h:83
 packet_snd net/packet/af_packet.c:2976 [inline]
 packet_sendmsg+0x483a/0x6780 net/packet/af_packet.c:3013
 sock_sendmsg_nosec net/socket.c:638 [inline]
 sock_sendmsg net/socket.c:658 [inline]
 kernel_sendmsg+0xf5/0x130 net/socket.c:678
 sock_no_sendpage+0x143/0x1b0 net/core/sock.c:2763
 kernel_sendpage net/socket.c:3764 [inline]
 sock_sendpage+0xd0/0x120 net/socket.c:936
 pipe_to_sendpage+0x23b/0x300 fs/splice.c:449
 splice_from_pipe_feed fs/splice.c:500 [inline]
 __splice_from_pipe+0x2d3/0x870 fs/splice.c:624
 splice_from_pipe fs/splice.c:659 [inline]
 generic_splice_sendpage+0x181/0x210 fs/splice.c:829
 do_splice_from fs/splice.c:848 [inline]
 do_splice fs/splice.c:1156 [inline]
 __do_sys_splice fs/splice.c:1433 [inline]
 __se_sys_splice+0x7a8/0x1b00 fs/splice.c:1413
 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x449239
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 a1 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f67eebe71f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00000000004cf518 RCX: 0000000000449239
RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00000000004cf510 R08: 000000000004ffe0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004cf51c
R13: 00007fff3b3a358f R14: 00007f67eebe7300 R15: 0000000000022000

Allocated by task 154:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 __kasan_kmalloc+0x137/0x1e0 mm/kasan/common.c:517
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc_node mm/slub.c:2821 [inline]
 slab_alloc mm/slub.c:2829 [inline]
 kmem_cache_alloc+0x115/0x290 mm/slub.c:2834
 getname_flags+0xba/0x640 fs/namei.c:141
 do_sys_open+0x33e/0x7c0 fs/open.c:1087
 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 154:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 kasan_set_free_info mm/kasan/common.c:333 [inline]
 __kasan_slab_free+0x18a/0x240 mm/kasan/common.c:475
 slab_free_hook mm/slub.c:1454 [inline]
 slab_free_freelist_hook+0x7b/0x150 mm/slub.c:1492
 slab_free mm/slub.c:3072 [inline]
 kmem_cache_free+0xb8/0x5f0 mm/slub.c:3088
 do_sys_open+0x62e/0x7c0 fs/open.c:1102
 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff8881e8be8000
 which belongs to the cache names_cache of size 4096
The buggy address is located 11 bytes inside of
 4096-byte region [ffff8881e8be8000, ffff8881e8be9000)
The buggy address belongs to the page:
page:ffffea0007a2fa00 refcount:1 mapcount:0 mapping:ffff8881f5cfa280 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5cfa280
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881e8be7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881e8be7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8881e8be8000: fb fb fb fb fb fb fb fb fb fb fb

Crashes (532):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-android-5-4-kasan 2021/04/10 15:32 android12-5.4 2c6775a89bc1 6a81331a .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/10 14:03 android12-5.4 2c6775a89bc1 6a81331a .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/31 11:36 android12-5.4 fb6ec348f060 6a81331a .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/31 03:00 android12-5.4 4a75e4d41639 6a81331a .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/24 22:05 android12-5.4 32de11228337 607e3baf .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/21 11:15 android12-5.4 543ec4541c0e 17810eae .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/21 10:46 android12-5.4 543ec4541c0e 17810eae .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/21 08:28 android12-5.4 543ec4541c0e 17810eae .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/17 21:26 android12-5.4 3941336d0e38 fdb2bb2c .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/17 21:23 android12-5.4 3941336d0e38 fdb2bb2c .config log report syz C KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/31 00:38 android12-5.4 4a75e4d41639 6a81331a .config log report syz C KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/10 02:09 android12-5.4 3b217c7fd679 6a81331a .config log report syz KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/16 01:47 android12-5.4 ce6a5172613f c59079a6 .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/15 22:02 android12-5.4 ce6a5172613f c59079a6 .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/15 17:48 android12-5.4 ce6a5172613f c59079a6 .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/15 17:29 android12-5.4 ce6a5172613f c59079a6 .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/15 16:23 android12-5.4 ce6a5172613f c59079a6 .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/15 13:29 android12-5.4 ce6a5172613f fcdb12ba .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/15 08:54 android12-5.4 ce6a5172613f fcdb12ba .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/15 07:13 android12-5.4 ce6a5172613f fcdb12ba .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/14 21:37 android12-5.4 ce6a5172613f fcdb12ba .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/14 14:15 android12-5.4 ce6a5172613f 3134b37f .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/14 12:29 android12-5.4 ce6a5172613f 3134b37f .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/14 10:08 android12-5.4 ce6a5172613f 3134b37f .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/14 09:04 android12-5.4 ce6a5172613f a184b83e .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/14 00:20 android12-5.4 a5dcde058bc3 a184b83e .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 22:54 android12-5.4 a5dcde058bc3 a184b83e .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 15:19 android12-5.4 a5dcde058bc3 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 13:41 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 12:21 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 07:48 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 04:57 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 03:32 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 20:46 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 10:47 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 09:37 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 09:27 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 07:35 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 02:00 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/11 20:45 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/11 14:26 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/11 04:59 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/10 17:50 android12-5.4 2c6775a89bc1 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/10 08:09 android12-5.4 2c6775a89bc1 6a81331a .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/17 19:43 android12-5.4 3941336d0e38 fdb2bb2c .config log report info KASAN: use-after-free Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/15 02:33 android12-5.4 ce6a5172613f fcdb12ba .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/14 22:50 android12-5.4 ce6a5172613f fcdb12ba .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/14 07:50 android12-5.4 ce6a5172613f a184b83e .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 19:11 android12-5.4 a5dcde058bc3 a184b83e .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/13 16:23 android12-5.4 a5dcde058bc3 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 18:40 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 16:55 android12-5.4 3c5dbcf40ba8 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 06:21 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/12 03:51 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/11 13:20 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/11 04:13 android12-5.4 94535fb224d4 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/11 01:43 android12-5.4 2c6775a89bc1 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/04/10 21:45 android12-5.4 2c6775a89bc1 6a81331a .config log report info KASAN: slab-out-of-bounds Read in eth_header_parse_protocol
ci2-android-5-4-kasan 2021/03/22 15:46 android12-5.4 543ec4541c0e bea32f74 .config log report info KASAN: out-of-bounds Read in eth_header_parse_protocol