syzbot


KASAN: use-after-free Read in skcipher_walk_next

Status: auto-closed as invalid on 2021/08/07 01:50
Subsystems: crypto
[Documentation on labels]
Reported-by: syzbot+4061a98a8ab454dde8ff@syzkaller.appspotmail.com
First crash: 1120d, last: 1120d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] KASAN: use-after-free Read in skcipher_walk_next 0 (1) 2021/04/13 05:44

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in memcpy include/linux/fortify-string.h:191 [inline]
BUG: KASAN: use-after-free in skcipher_next_copy crypto/skcipher.c:292 [inline]
BUG: KASAN: use-after-free in skcipher_walk_next+0xb69/0x1680 crypto/skcipher.c:379
Read of size 2785 at addr ffff8880781c0000 by task kworker/u4:3/204

CPU: 0 PID: 204 Comm: kworker/u4:3 Not tainted 5.12.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: pencrypt_parallel padata_parallel_worker
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232
 __kasan_report mm/kasan/report.c:399 [inline]
 kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416
 check_region_inline mm/kasan/generic.c:180 [inline]
 kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186
 memcpy+0x20/0x60 mm/kasan/shadow.c:65
 memcpy include/linux/fortify-string.h:191 [inline]
 skcipher_next_copy crypto/skcipher.c:292 [inline]
 skcipher_walk_next+0xb69/0x1680 crypto/skcipher.c:379
 skcipher_walk_done+0x7a3/0xf00 crypto/skcipher.c:159
 gcmaes_crypt_by_sg+0x377/0x8a0 arch/x86/crypto/aesni-intel_glue.c:694

The buggy address belongs to the page:
page:ffffea0001e07000 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x781c0
flags: 0xfff00000000000()
raw: 00fff00000000000 ffffea0001e06808 ffffea0001c67008 0000000000000000
raw: 0000000000000001 0000000000000004 00000000ffffff7f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880781bff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880781bff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8880781c0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff8880781c0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880781c0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/04/09 01:49 upstream 4fa56ad0d12e 6a81331a .config console log report info ci-upstream-kasan-gce-root KASAN: use-after-free Read in skcipher_walk_next
* Struck through repros no longer work on HEAD.