syzbot


general protection fault in crypto_shash_final

Status: fixed on 2023/09/28 17:51
Subsystems: crypto
[Documentation on labels]
Reported-by: syzbot+14234ccf6d0ef629ec1a@syzkaller.appspotmail.com
Fix commit: b6d972f68983 crypto: af_alg/hash: Fix recvmsg() after sendmsg(MSG_MORE)
First crash: 351d, last: 351d
Cause bisection: introduced by (bisect log) :
commit c662b043cdca89bf0f03fc37251000ac69a3a548
Author: David Howells <dhowells@redhat.com>
Date: Tue Jun 6 13:08:56 2023 +0000

  crypto: af_alg/hash: Support MSG_SPLICE_PAGES

Crash: general protection fault in crypto_shash_final (log)
Repro: C syz .config
  
Discussions (5)
Title Replies (including bot) Last reply
[syzbot] [crypto?] general protection fault in shash_ahash_update 4 (9) 2023/07/25 15:18
[PATCH net-next v2] crypto: af_alg/hash: Fix recvmsg() after sendmsg(MSG_MORE) 7 (7) 2023/06/20 19:20
[PATCH net-next] crypto: af_alg/hash: Fix recvmsg() after sendmsg(MSG_MORE) 9 (9) 2023/06/20 04:47
[syzbot] [crypto?] general protection fault in shash_async_final 5 (8) 2023/06/16 05:01
[syzbot] [crypto?] general protection fault in crypto_shash_final 1 (3) 2023/06/14 16:13
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/06/14 14:51 32m dhowells@redhat.com patch git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main OK log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027]
CPU: 1 PID: 5006 Comm: kworker/1:3 Not tainted 6.4.0-rc5-syzkaller-00859-g37ff78e977f1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
Workqueue: cryptd cryptd_queue_worker
RIP: 0010:crypto_shash_alg include/crypto/hash.h:827 [inline]
RIP: 0010:crypto_shash_final+0x49/0x120 crypto/shash.c:171
Code: fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 d5 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5d 00 48 8d 7b 20 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 a8 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b
RSP: 0018:ffffc90003a3fca8 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000004 RSI: ffffffff83df1715 RDI: 0000000000000020
RBP: ffff88801b756b08 R08: 0000000000000005 R09: 00000000ffffff8d
R10: 0000000000000000 R11: 1ffffffff21842f8 R12: ffff888029311988
R13: ffff88801b756b08 R14: ffff888014eaa600 R15: ffff8880b993bd80
FS:  0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6c11c57440 CR3: 00000000221e4000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 cryptd_hash_final+0xea/0x140 crypto/cryptd.c:580
 crypto_request_complete include/crypto/algapi.h:272 [inline]
 cryptd_queue_worker+0x130/0x1d0 crypto/cryptd.c:181
 process_one_work+0x99a/0x15e0 kernel/workqueue.c:2405
 worker_thread+0x67d/0x10c0 kernel/workqueue.c:2552
 kthread+0x344/0x440 kernel/kthread.c:379
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:crypto_shash_alg include/crypto/hash.h:827 [inline]
RIP: 0010:crypto_shash_final+0x49/0x120 crypto/shash.c:171
Code: fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 d5 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5d 00 48 8d 7b 20 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 a8 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b
RSP: 0018:ffffc90003a3fca8 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000004 RSI: ffffffff83df1715 RDI: 0000000000000020
RBP: ffff88801b756b08 R08: 0000000000000005 R09: 00000000ffffff8d
R10: 0000000000000000 R11: 1ffffffff21842f8 R12: ffff888029311988
R13: ffff88801b756b08 R14: ffff888014eaa600 R15: ffff8880b993bd80
FS:  0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6c11c57440 CR3: 00000000221e4000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 3 bytes skipped:
   0:	48 c1 ea 03          	shr    $0x3,%rdx
   4:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   8:	0f 85 d5 00 00 00    	jne    0xe3
   e:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  15:	fc ff df
  18:	48 8b 5d 00          	mov    0x0(%rbp),%rbx
  1c:	48 8d 7b 20          	lea    0x20(%rbx),%rdi
  20:	48 89 fa             	mov    %rdi,%rdx
  23:	48 c1 ea 03          	shr    $0x3,%rdx
* 27:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2b:	0f 85 a8 00 00 00    	jne    0xd9
  31:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  38:	fc ff df
  3b:	48                   	rex.W
  3c:	8b                   	.byte 0x8b

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/09 09:41 net-next 37ff78e977f1 7086cdb9 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in crypto_shash_final
2023/06/09 09:15 net-next 37ff78e977f1 7086cdb9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in crypto_shash_final
* Struck through repros no longer work on HEAD.