syzbot


KASAN: use-after-free Read in scatterwalk_copychunks

Status: upstream: reported C repro on 2019/10/03 04:34
Reported-by: syzbot+f516dd345e6d76742e0e@syzkaller.appspotmail.com
First crash: 1893d, last: 678d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (9)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in scatterwalk_copychunks (4) net crypto C done done 1341 352d 1363d 25/28 fixed on 2023/12/22 15:08
linux-4.14 KASAN: use-after-free Read in scatterwalk_copychunks C inconclusive 4 1403d 2058d 0/1 upstream: reported C repro on 2019/04/21 07:18
upstream KASAN: use-after-free Read in scatterwalk_copychunks bcachefs C done 36 25d 218d 0/28 upstream: reported C repro on 2024/05/04 09:57
linux-4.14 KASAN: slab-out-of-bounds Read in scatterwalk_copychunks C inconclusive 6 1411d 1915d 0/1 upstream: reported C repro on 2019/09/11 08:57
linux-4.14 general protection fault in scatterwalk_copychunks C error 204 666d 2058d 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 592d 629d 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 540d 540d 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 667d 1998d 0/1 upstream: reported C repro on 2019/06/20 18:59
upstream general protection fault in scatterwalk_copychunks (5) crypto C done 2920 341d 348d 25/28 fixed on 2024/01/30 15:47
Fix bisection attempts (22)
Created Duration User Patch Repo Result
2021/11/06 08:50 15m bisect fix linux-4.19.y error job log
2021/10/07 08:18 31m bisect fix linux-4.19.y OK (0) job log log
2021/08/12 23:09 27m bisect fix linux-4.19.y OK (0) job log log
2021/07/13 22:44 24m bisect fix linux-4.19.y OK (0) job log log
2021/06/13 22:11 26m bisect fix linux-4.19.y OK (0) job log log
2021/05/14 21:25 29m bisect fix linux-4.19.y OK (0) job log log
2021/03/30 08:22 22m bisect fix linux-4.19.y OK (0) job log log
2021/02/28 07:42 23m bisect fix linux-4.19.y OK (0) job log log
2021/01/29 06:59 26m bisect fix linux-4.19.y OK (0) job log log
2020/12/30 03:22 23m bisect fix linux-4.19.y OK (0) job log log
2020/11/29 17:54 25m bisect fix linux-4.19.y OK (0) job log log
2020/10/07 03:37 25m bisect fix linux-4.19.y OK (0) job log log
2020/09/07 02:55 28m bisect fix linux-4.19.y OK (0) job log log
2020/08/07 15:35 26m bisect fix linux-4.19.y OK (0) job log log
2020/07/08 15:10 24m bisect fix linux-4.19.y OK (0) job log log
2020/06/08 14:46 24m bisect fix linux-4.19.y OK (0) job log log
2020/05/09 14:18 27m bisect fix linux-4.19.y OK (0) job log log
2020/04/09 13:53 24m bisect fix linux-4.19.y OK (0) job log log
2020/03/10 13:26 26m bisect fix linux-4.19.y OK (0) job log log
2020/02/09 13:00 25m bisect fix linux-4.19.y OK (0) job log log
2020/01/10 12:34 26m bisect fix linux-4.19.y OK (0) job log log
2019/12/11 08:54 25m bisect fix linux-4.19.y OK (0) job log log

Sample crash report:
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000005 R08: 000000011d100000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401f80
R13: 0000000000402010 R14: 0000000000000000 R15: 0000000000000000
==================================================================
BUG: KASAN: use-after-free in memcpy include/linux/string.h:348 [inline]
BUG: KASAN: use-after-free in memcpy_dir crypto/scatterwalk.c:28 [inline]
BUG: KASAN: use-after-free in scatterwalk_copychunks+0x269/0x6a0 crypto/scatterwalk.c:43
Read of size 4096 at addr ffff8880a0a71000 by task syz-executor177/7508

CPU: 0 PID: 7508 Comm: syz-executor177 Not tainted 4.19.76 #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+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/0x160 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+0x538/0xd50 net/tls/tls_sw.c:585
 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:0x440699
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:00007fffe78b5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007fffe78b5040 RCX: 0000000000440699
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000005 R08: 000000011d100000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401f80
R13: 0000000000402010 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 5909:
 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
 anon_vma_chain_alloc mm/rmap.c:129 [inline]
 anon_vma_fork+0x1ea/0x4a0 mm/rmap.c:344
 dup_mmap kernel/fork.c:499 [inline]
 dup_mm kernel/fork.c:1283 [inline]
 copy_mm kernel/fork.c:1339 [inline]
 copy_process.part.0+0x34e5/0x7a30 kernel/fork.c:1892
 copy_process kernel/fork.c:1689 [inline]
 _do_fork+0x257/0xfd0 kernel/fork.c:2202
 __do_sys_clone kernel/fork.c:2309 [inline]
 __se_sys_clone kernel/fork.c:2303 [inline]
 __x64_sys_clone+0xbf/0x150 kernel/fork.c:2303
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 5914:
 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
 anon_vma_chain_free mm/rmap.c:134 [inline]
 unlink_anon_vmas+0x487/0x860 mm/rmap.c:419
 free_pgtables+0x1af/0x2f0 mm/memory.c:640
 exit_mmap+0x2d1/0x530 mm/mmap.c:3098
 __mmput kernel/fork.c:1010 [inline]
 mmput+0x15f/0x4c0 kernel/fork.c:1031
 exec_mmap fs/exec.c:1043 [inline]
 flush_old_exec+0x8d9/0x1c20 fs/exec.c:1276
 load_elf_binary+0x9c0/0x5350 fs/binfmt_elf.c:869
 search_binary_handler fs/exec.c:1653 [inline]
 search_binary_handler+0x179/0x570 fs/exec.c:1631
 exec_binprm fs/exec.c:1695 [inline]
 __do_execve_file.isra.0+0x1227/0x2150 fs/exec.c:1819
 do_execveat_common fs/exec.c:1866 [inline]
 do_execve fs/exec.c:1883 [inline]
 __do_sys_execve fs/exec.c:1964 [inline]
 __se_sys_execve fs/exec.c:1959 [inline]
 __x64_sys_execve+0x8f/0xc0 fs/exec.c:1959
 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 ffff8880a0a71000
 which belongs to the cache anon_vma_chain of size 80
The buggy address is located 0 bytes inside of
 80-byte region [ffff8880a0a71000, ffff8880a0a71050)
The buggy address belongs to the page:
page:ffffea0002829c40 count:1 mapcount:0 mapping:ffff88821bc334c0 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffffea00026d7d08 ffffea000280cb48 ffff88821bc334c0
raw: 0000000000000000 ffff8880a0a71000 0000000100000024 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a0a70f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880a0a70f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8880a0a71000: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fb fb
                   ^
 ffff8880a0a71080: fb fb fb fb fb fb fb fb fc fc fc fc fb fb fb fb
 ffff8880a0a71100: fb fb fb fb fb fb fc fc fc fc fb fb fb fb fb fb
==================================================================

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/03 04:01 linux-4.19.y 555161ee1b7a 2e29b534 .config console log report syz C ci2-linux-4-19
2023/01/30 18:11 linux-4.19.y 3f8a27f9e27b b68fb8d6 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2022/10/28 06:06 linux-4.19.y 3f8a27f9e27b 5c716ff6 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2022/08/05 17:54 linux-4.19.y 3f8a27f9e27b a65a7ce9 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2022/07/24 12:20 linux-4.19.y 3f8a27f9e27b 22343af4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2022/06/23 07:35 linux-4.19.y 3f8a27f9e27b 912f5df7 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2022/06/15 17:54 linux-4.19.y 3f8a27f9e27b 1719ee24 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2022/05/11 23:23 linux-4.19.y 3f8a27f9e27b beb0b407 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2022/01/28 08:22 linux-4.19.y 3f8a27f9e27b 495e00c5 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2021/09/07 07:28 linux-4.19.y b172b44fcb17 6ca60148 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2021/08/20 10:31 linux-4.19.y 59456c9cc40c b599f2fc .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2021/04/14 21:25 linux-4.19.y 0f1b4cb77d7f 3134b37f .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in scatterwalk_copychunks
2020/10/30 17:54 linux-4.19.y f5d8eef067ac a6e3ac3b .config console log report info ci2-linux-4-19
2020/10/23 17:42 linux-4.19.y ad326970d25c 4e740c00 .config console log report info ci2-linux-4-19
2020/10/21 19:50 linux-4.19.y ad326970d25c 99c64d5c .config console log report info ci2-linux-4-19
2019/10/03 05:51 linux-4.19.y 555161ee1b7a 2e29b534 .config console log report ci2-linux-4-19
2019/10/03 03:33 linux-4.19.y 555161ee1b7a 2e29b534 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.