syzbot


KASAN: slab-out-of-bounds Read in scatterwalk_copychunks

Status: upstream: reported C repro on 2019/06/21 13:46
Reported-by: syzbot+67463b0de04ce7586b24@syzkaller.appspotmail.com
First crash: 1801d, last: 976d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in scatterwalk_copychunks C inconclusive 6 1215d 1719d 0/1 upstream: reported C repro on 2019/09/11 08:57
Fix bisection attempts (23)
Created Duration User Patch Repo Result
2021/10/28 12:20 11m bisect fix linux-4.19.y error job log (0)
2021/09/23 23:57 24m bisect fix linux-4.19.y job log (0) log
2021/08/24 19:30 31m bisect fix linux-4.19.y job log (0) log
2021/07/25 18:58 28m bisect fix linux-4.19.y job log (0) log
2021/06/25 18:31 21m bisect fix linux-4.19.y job log (0) log
2021/05/26 17:46 28m bisect fix linux-4.19.y job log (0) log
2021/04/26 17:16 29m bisect fix linux-4.19.y job log (0) log
2021/03/27 15:43 21m bisect fix linux-4.19.y job log (0) log
2021/02/25 15:20 23m bisect fix linux-4.19.y job log (0) log
2021/01/26 14:56 22m bisect fix linux-4.19.y job log (0) log
2020/12/27 14:31 24m bisect fix linux-4.19.y job log (0) log
2020/11/27 13:28 26m bisect fix linux-4.19.y job log (0) log
2020/10/28 13:05 23m bisect fix linux-4.19.y job log (0) log
2020/09/28 12:40 25m bisect fix linux-4.19.y job log (0) log
2020/08/29 09:27 26m bisect fix linux-4.19.y job log (0) log
2020/07/29 07:50 26m bisect fix linux-4.19.y job log (0) log
2020/06/29 07:26 23m bisect fix linux-4.19.y job log (0) log
2020/05/30 07:02 23m bisect fix linux-4.19.y job log (0) log
2020/04/30 04:58 26m bisect fix linux-4.19.y job log (0) log
2020/03/31 04:33 23m bisect fix linux-4.19.y job log (0) log
2020/03/01 04:06 25m bisect fix linux-4.19.y job log (0) log
2020/01/10 20:25 25m bisect fix linux-4.19.y job log (0) log
2019/12/11 20:00 24m bisect fix linux-4.19.y job log (0) log

Sample crash report:
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000005 R08: 0000000100000300 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000402000
R13: 0000000000402090 R14: 0000000000000000 R15: 0000000000000000
==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:348 [inline]
BUG: KASAN: slab-out-of-bounds in memcpy_dir crypto/scatterwalk.c:28 [inline]
BUG: KASAN: slab-out-of-bounds in scatterwalk_copychunks+0x269/0x6a0 crypto/scatterwalk.c:43
Read of size 4094 at addr ffff8880915da000 by task syz-executor780/7867

CPU: 0 PID: 7867 Comm: syz-executor780 Not tainted 4.19.53+ #25
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+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report mm/kasan/report.c:412 [inline]
 kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396
 check_memory_region_inline mm/kasan/kasan.c:260 [inline]
 check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
 memcpy+0x24/0x50 mm/kasan/kasan.c:302
 memcpy include/linux/string.h:348 [inline]
 memcpy_dir crypto/scatterwalk.c:28 [inline]
 scatterwalk_copychunks+0x269/0x6a0 crypto/scatterwalk.c:43
 scatterwalk_map_and_copy crypto/scatterwalk.c:72 [inline]
 scatterwalk_map_and_copy+0x14d/0x1d0 crypto/scatterwalk.c:60
 gcmaes_encrypt.constprop.0+0x762/0xd90 arch/x86/crypto/aesni-intel_glue.c:956
 generic_gcmaes_encrypt+0x108/0x159 arch/x86/crypto/aesni-intel_glue.c:1297
 crypto_aead_encrypt include/crypto/aead.h:335 [inline]
 gcmaes_wrapper_encrypt+0x15f/0x200 arch/x86/crypto/aesni-intel_glue.c:1130
 crypto_aead_encrypt include/crypto/aead.h:335 [inline]
 tls_do_encryption net/tls/tls_sw.c:193 [inline]
 tls_push_record+0x9c0/0x13a0 net/tls/tls_sw.c:228
 tls_sw_sendpage+0x540/0xd40 net/tls/tls_sw.c:583
 inet_sendpage+0x168/0x630 net/ipv4/af_inet.c:815
 kernel_sendpage+0x92/0xf0 net/socket.c:3377
 sock_sendpage+0x8b/0xc0 net/socket.c:847
 pipe_to_sendpage+0x296/0x360 fs/splice.c:452
 splice_from_pipe_feed fs/splice.c:503 [inline]
 __splice_from_pipe+0x391/0x7d0 fs/splice.c:627
 splice_from_pipe+0x108/0x170 fs/splice.c:662
 generic_splice_sendpage+0x3c/0x50 fs/splice.c:833
 do_splice_from fs/splice.c:852 [inline]
 do_splice+0x642/0x12c0 fs/splice.c:1148
 __do_sys_splice fs/splice.c:1415 [inline]
 __se_sys_splice fs/splice.c:1395 [inline]
 __x64_sys_splice+0x2c6/0x330 fs/splice.c:1395
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440719
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 5b 14 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffece804408 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007ffece804420 RCX: 0000000000440719
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000005 R08: 0000000100000300 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000402000
R13: 0000000000402090 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 6780:
 save_stack+0x45/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc mm/kasan/kasan.c:553 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531
 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:490
 kmem_cache_alloc+0x12e/0x700 mm/slab.c:3559
 getname_flags fs/namei.c:140 [inline]
 getname_flags+0xd6/0x5b0 fs/namei.c:129
 getname+0x1a/0x20 fs/namei.c:211
 do_sys_open+0x2c9/0x550 fs/open.c:1063
 __do_sys_open fs/open.c:1087 [inline]
 __se_sys_open fs/open.c:1082 [inline]
 __x64_sys_open+0x7e/0xc0 fs/open.c:1082
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 6780:
 save_stack+0x45/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3503 [inline]
 kmem_cache_free+0x86/0x260 mm/slab.c:3765
 putname+0xef/0x130 fs/namei.c:261
 do_sys_open+0x318/0x550 fs/open.c:1078
 __do_sys_open fs/open.c:1087 [inline]
 __se_sys_open fs/open.c:1082 [inline]
 __x64_sys_open+0x7e/0xc0 fs/open.c:1082
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880915daa00
 which belongs to the cache names_cache of size 4096
The buggy address is located 2560 bytes to the left of
 4096-byte region [ffff8880915daa00, ffff8880915dba00)
The buggy address belongs to the page:
page:ffffea0002457680 count:1 mapcount:0 mapping:ffff88821bc45b00 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000008100(slab|head)
raw: 01fffc0000008100 ffffea00023b7388 ffffea0002457808 ffff88821bc45b00
raw: 0000000000000000 ffff8880915daa00 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880915d9f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880915d9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8880915da000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff8880915da080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880915da100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/21 13:26 linux-4.19.y 9f31eb60d7a2 34bf9440 .config console log report syz C ci2-linux-4-19
2020/01/31 03:47 linux-4.19.y 7cdefde351b6 5ed23f9a .config console log report ci2-linux-4-19
2019/10/09 23:29 linux-4.19.y 58fce2064530 c4b9981b .config console log report ci2-linux-4-19
2019/07/18 20:45 linux-4.19.y 3bd837bfe431 7bb222f7 .config console log report ci2-linux-4-19
2019/06/21 12:45 linux-4.19.y 9f31eb60d7a2 34bf9440 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.