syzbot


KASAN: use-after-free Read in skb_segment

Status: fixed on 2021/04/09 19:46
Subsystems: net
[Documentation on labels]
Fix commit: 00b229f762b0 net: fix GSO for SG-enabled devices
First crash: 1425d, last: 1421d
Cause bisection: failed (error log, bisect log)
  

Sample crash report:
netdevsim netdevsim0 netdevsim1: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim0 netdevsim2: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim0 netdevsim3: set [1, 0] type 2 family 0 port 6081 - 0
==================================================================
BUG: KASAN: use-after-free in memcpy include/linux/string.h:447 [inline]
BUG: KASAN: use-after-free in skb_copy_from_linear_data_offset include/linux/skbuff.h:3676 [inline]
BUG: KASAN: use-after-free in skb_segment+0x14ba/0x37a0 net/core/skbuff.c:3996
Read of size 2324 at addr ffff88801a8ff2f7 by task syz-executor061/8471

CPU: 0 PID: 8471 Comm: syz-executor061 Not tainted 5.11.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230
 __kasan_report mm/kasan/report.c:396 [inline]
 kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413
 check_memory_region_inline mm/kasan/generic.c:179 [inline]
 check_memory_region+0x13d/0x180 mm/kasan/generic.c:185
 memcpy+0x20/0x60 mm/kasan/shadow.c:64
 memcpy include/linux/string.h:447 [inline]
 skb_copy_from_linear_data_offset include/linux/skbuff.h:3676 [inline]
 skb_segment+0x14ba/0x37a0 net/core/skbuff.c:3996
 udp4_ufo_fragment+0x4ae/0x700 net/ipv4/udp_offload.c:363
 inet_gso_segment+0x502/0x1110 net/ipv4/af_inet.c:1378
 skb_mac_gso_segment+0x26e/0x530 net/core/dev.c:3326
 __skb_gso_segment+0x330/0x6e0 net/core/dev.c:3399
 skb_gso_segment include/linux/netdevice.h:4708 [inline]
 validate_xmit_skb+0x69e/0xee0 net/core/dev.c:3644
 __dev_queue_xmit+0x988/0x2dd0 net/core/dev.c:4142
 packet_snd net/packet/af_packet.c:3006 [inline]
 packet_sendmsg+0x2406/0x52a0 net/packet/af_packet.c:3031
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 __sys_sendto+0x21c/0x320 net/socket.c:1975
 __do_sys_sendto net/socket.c:1987 [inline]
 __se_sys_sendto net/socket.c:1983 [inline]
 __x64_sys_sendto+0xdd/0x1b0 net/socket.c:1983
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x4436e9
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 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 0f 83 eb 0d fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fffe7591c98 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004436e9
RDX: 000000000000fc13 RSI: 0000000020000280 RDI: 0000000000000003
RBP: 00007fffe7591cb0 R08: 0000000000000000 R09: 000000000000002f
R10: 0000000000000800 R11: 0000000000000246 R12: 00007fffe7591cc0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 6431:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:401 [inline]
 ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429
 kasan_slab_alloc include/linux/kasan.h:205 [inline]
 slab_post_alloc_hook mm/slab.h:512 [inline]
 slab_alloc_node mm/slub.c:2891 [inline]
 slab_alloc mm/slub.c:2899 [inline]
 kmem_cache_alloc+0x1c6/0x440 mm/slub.c:2904
 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138
 getname_flags include/linux/audit.h:319 [inline]
 getname+0x8e/0xd0 fs/namei.c:209
 do_sys_openat2+0xf5/0x420 fs/open.c:1166
 do_sys_open fs/open.c:1188 [inline]
 __do_sys_open fs/open.c:1196 [inline]
 __se_sys_open fs/open.c:1192 [inline]
 __x64_sys_open+0x119/0x1c0 fs/open.c:1192
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 6431:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46
 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356
 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362
 kasan_slab_free include/linux/kasan.h:188 [inline]
 slab_free_hook mm/slub.c:1547 [inline]
 slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580
 slab_free mm/slub.c:3142 [inline]
 kmem_cache_free+0x82/0x350 mm/slub.c:3158
 putname+0xe1/0x120 fs/namei.c:259
 do_sys_openat2+0x153/0x420 fs/open.c:1181
 do_sys_open fs/open.c:1188 [inline]
 __do_sys_open fs/open.c:1196 [inline]
 __se_sys_open fs/open.c:1192 [inline]
 __x64_sys_open+0x119/0x1c0 fs/open.c:1192
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff88801a8fe600
 which belongs to the cache names_cache of size 4096
The buggy address is located 3319 bytes inside of
 4096-byte region [ffff88801a8fe600, ffff88801a8ff600)
The buggy address belongs to the page:
page:0000000036b7a58f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1a8f8
head:0000000036b7a58f order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head)
raw: 00fff00000010200 0000000000000000 0000000500000001 ffff8880101be140
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88801a8ff180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801a8ff200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801a8ff280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
 ffff88801a8ff300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801a8ff380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (55):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/17 14:00 net-next-old 213b97b12580 813be542 .config console log report syz C ci-upstream-net-kasan-gce
2021/01/20 05:04 net-next-old 7eab14de73a8 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/19 17:10 net-next-old 99d518970c5a 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/19 10:17 net-next-old 99d518970c5a 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/19 10:05 net-next-old 99d518970c5a 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/19 09:38 net-next-old 99d518970c5a 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/19 07:57 net-next-old 220723dc3bcf 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/19 05:53 net-next-old 220723dc3bcf 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/19 02:24 net-next-old 220723dc3bcf 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/19 01:41 net-next-old 220723dc3bcf 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 21:11 net-next-old 220723dc3bcf 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 20:59 net-next-old 220723dc3bcf 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 20:48 net-next-old 220723dc3bcf 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 16:06 net-next-old 213b97b12580 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 14:15 net-next-old 213b97b12580 63631df1 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 12:19 net-next-old 213b97b12580 fd103621 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 11:48 net-next-old 213b97b12580 fd103621 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 07:31 net-next-old 213b97b12580 fd103621 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 04:06 net-next-old 213b97b12580 fd103621 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 02:50 net-next-old 213b97b12580 fd103621 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 01:56 net-next-old 213b97b12580 fd103621 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 00:49 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/18 00:45 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/17 22:28 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/17 19:05 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/17 18:19 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in skb_segment
2021/01/21 05:40 linux-next 647060f3b592 d4f4eca5 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/21 03:28 linux-next 647060f3b592 d4f4eca5 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/20 16:12 linux-next 647060f3b592 d4f4eca5 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/20 14:30 linux-next 647060f3b592 d4f4eca5 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/20 10:52 linux-next 647060f3b592 d4f4eca5 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/20 03:05 linux-next b4bb878f3eb3 63631df1 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/19 23:01 linux-next b4bb878f3eb3 63631df1 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/19 19:42 linux-next b4bb878f3eb3 63631df1 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/19 10:06 linux-next b4bb878f3eb3 63631df1 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/19 08:49 linux-next b4bb878f3eb3 63631df1 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 20:23 linux-next 93bf8b946e5f 63631df1 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 16:28 linux-next 93bf8b946e5f 63631df1 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 15:06 linux-next 93bf8b946e5f 63631df1 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 13:11 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 12:54 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 12:15 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 11:45 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 11:41 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 10:53 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/18 10:07 linux-next 93bf8b946e5f fd103621 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in skb_segment
2021/01/17 12:34 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce
2021/01/17 12:26 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce
2021/01/17 11:59 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce
2021/01/17 11:56 net-next-old 213b97b12580 813be542 .config console log report info ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.