syzbot


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

Status: upstream: reported C repro on 2019/09/11 08:57
Reported-by: syzbot+b9e2e1efdc969e74853b@syzkaller.appspotmail.com
First crash: 1660d, last: 1156d
Fix bisection the fix commit could be any of (bisect log):
  f6e27dbb1afa Linux 4.14.146
  4139fb08c05f Linux 4.14.187
  
Similar bugs (9)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: slab-out-of-bounds Read in scatterwalk_copychunks C error 5 916d 1742d 0/1 upstream: reported C repro on 2019/06/21 13:46
upstream general protection fault in scatterwalk_copychunks (4) net crypto C done done 1341 97d 1108d 25/26 fixed on 2023/12/22 15:08
linux-4.14 KASAN: use-after-free Read in scatterwalk_copychunks C inconclusive 4 1148d 1803d 0/1 upstream: reported C repro on 2019/04/21 07:18
linux-4.19 KASAN: use-after-free Read in scatterwalk_copychunks C error 17 423d 1638d 0/1 upstream: reported C repro on 2019/10/03 04:34
linux-4.14 general protection fault in scatterwalk_copychunks C error 204 411d 1803d 0/1 upstream: reported C repro on 2019/04/21 07:15
linux-5.15 BUG: unable to handle kernel paging request in scatterwalk_copychunks 3 337d 374d 0/3 auto-obsoleted due to no activity on 2023/08/23 09:08
linux-6.1 BUG: unable to handle kernel paging request in scatterwalk_copychunks 1 285d 285d 0/3 auto-obsoleted due to no activity on 2023/09/25 13:18
linux-4.19 general protection fault in scatterwalk_copychunks C error 152 412d 1743d 0/1 upstream: reported C repro on 2019/06/20 18:59
upstream general protection fault in scatterwalk_copychunks (5) crypto C done 2920 86d 93d 26/26 fixed on 2024/01/30 15:47
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/02/06 10:32 15m retest repro linux-4.14.y report log
2022/09/15 20:29 13m retest repro linux-4.14.y report log
Fix bisection attempts (7)
Created Duration User Patch Repo Result
2020/06/29 03:36 29m (3) bisect fix linux-4.14.y job log (2)
2020/05/30 01:18 24m bisect fix linux-4.14.y job log (0) log
2020/04/30 00:52 25m bisect fix linux-4.14.y job log (0) log
2020/03/08 17:38 26m bisect fix linux-4.14.y job log (0) log
2020/02/07 17:14 23m bisect fix linux-4.14.y job log (0) log
2020/01/08 16:50 24m bisect fix linux-4.14.y job log (0) log
2019/12/09 14:03 23m bisect fix linux-4.14.y job log (0) log

Sample crash report:
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000005 R08: 0000000100000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401f60
R13: 0000000000401ff0 R14: 0000000000000000 R15: 0000000000000000
==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:347 [inline]
BUG: KASAN: slab-out-of-bounds in memcpy_dir crypto/scatterwalk.c:28 [inline]
BUG: KASAN: slab-out-of-bounds in scatterwalk_copychunks+0x260/0x6b0 crypto/scatterwalk.c:43
Read of size 4096 at addr ffff88808bacd000 by task syz-executor020/6826

CPU: 1 PID: 6826 Comm: syz-executor020 Not tainted 4.14.146 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x138/0x197 lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 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:347 [inline]
 memcpy_dir crypto/scatterwalk.c:28 [inline]
 scatterwalk_copychunks+0x260/0x6b0 crypto/scatterwalk.c:43
 scatterwalk_map_and_copy crypto/scatterwalk.c:72 [inline]
 scatterwalk_map_and_copy+0x12f/0x1d0 crypto/scatterwalk.c:60
 gcmaes_encrypt.constprop.0+0x1d2/0xb90 arch/x86/crypto/aesni-intel_glue.c:778
 generic_gcmaes_encrypt+0xf4/0x130 arch/x86/crypto/aesni-intel_glue.c:1111
 crypto_aead_encrypt include/crypto/aead.h:330 [inline]
 gcmaes_wrapper_encrypt+0xef/0x150 arch/x86/crypto/aesni-intel_glue.c:945
 crypto_aead_encrypt include/crypto/aead.h:330 [inline]
 tls_do_encryption net/tls/tls_sw.c:234 [inline]
 tls_push_record+0x906/0x1210 net/tls/tls_sw.c:270
 tls_sw_sendpage+0x434/0xb50 net/tls/tls_sw.c:617
 inet_sendpage+0x157/0x580 net/ipv4/af_inet.c:779
 kernel_sendpage+0x92/0xf0 net/socket.c:3406
 sock_sendpage+0x8b/0xc0 net/socket.c:871
 pipe_to_sendpage+0x242/0x340 fs/splice.c:451
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x348/0x780 fs/splice.c:626
 splice_from_pipe+0xf0/0x150 fs/splice.c:661
 generic_splice_sendpage+0x3c/0x50 fs/splice.c:832
 do_splice_from fs/splice.c:851 [inline]
 do_splice fs/splice.c:1147 [inline]
 SYSC_splice fs/splice.c:1402 [inline]
 SyS_splice+0xd92/0x1430 fs/splice.c:1382
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x440679
RSP: 002b:00007ffcccb335f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007ffcccb33610 RCX: 0000000000440679
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000005 R08: 0000000100000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401f60
R13: 0000000000401ff0 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 3568:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:489
 kmem_cache_alloc+0x12e/0x780 mm/slab.c:3552
 shmem_alloc_inode+0x1c/0x50 mm/shmem.c:3882
 alloc_inode+0x64/0x180 fs/inode.c:209
 new_inode_pseudo+0x19/0xf0 fs/inode.c:891
 new_inode+0x1f/0x40 fs/inode.c:920
 shmem_get_inode+0x75/0x750 mm/shmem.c:2172
 shmem_mknod+0x5a/0x1d0 mm/shmem.c:3030
 shmem_create+0x2b/0x40 mm/shmem.c:3090
 lookup_open+0x11a6/0x1860 fs/namei.c:3240
 do_last fs/namei.c:3331 [inline]
 path_openat+0xfca/0x3f70 fs/namei.c:3566
 do_filp_open+0x18e/0x250 fs/namei.c:3600
 do_sys_open+0x2c5/0x430 fs/open.c:1084
 SYSC_open fs/open.c:1102 [inline]
 SyS_open+0x2d/0x40 fs/open.c:1097
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88808bacd000
 which belongs to the cache shmem_inode_cache of size 1200
The buggy address is located 0 bytes inside of
 1200-byte region [ffff88808bacd000, ffff88808bacd4b0)
The buggy address belongs to the page:
page:ffffea00022eb340 count:1 mapcount:0 mapping:ffff88808bacd000 index:0xffff88808bacdffd
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff88808bacd000 ffff88808bacdffd 0000000100000003
raw: ffffea00022e9120 ffffea00022d6ea0 ffff8880aa9e03c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808bacd380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88808bacd400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88808bacd480: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc
                                     ^
 ffff88808bacd500: fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00
 ffff88808bacd580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/09/25 18:26 linux-4.14.y f6e27dbb1afa a3355dba .config console log report syz C ci2-linux-4-14
2021/01/27 03:24 linux-4.14.y 2d2791fce891 55a7d4df .config console log report info ci2-linux-4-14 KASAN: slab-out-of-bounds Read in scatterwalk_copychunks
2020/03/31 00:52 linux-4.14.y 01364dad1d45 c8d1cc20 .config console log report ci2-linux-4-14
2019/09/27 03:31 linux-4.14.y f6e27dbb1afa 2f1548bc .config console log report ci2-linux-4-14
2019/09/25 17:55 linux-4.14.y f6e27dbb1afa a3355dba .config console log report ci2-linux-4-14
2019/09/11 07:56 linux-4.14.y e2cd24b62938 a60cb4cd .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.