diff mbox series

crypto: akcipher - Set request tfm on sync path

Message ID ZJlmaarLRYZcs+c3@gondor.apana.org.au (mailing list archive)
State New
Headers show
Series crypto: akcipher - Set request tfm on sync path | expand

Commit Message

Herbert Xu June 26, 2023, 10:20 a.m. UTC
On Mon, Jun 26, 2023 at 03:07:01PM +0800, kernel test robot wrote:
>
> [    7.727242][    T1] cfg80211: Loading compiled-in X.509 certificates for regulatory database
> [    7.737831][    T1] BUG: kernel NULL pointer dereference, address: 00000010
> [    7.739122][    T1] #PF: supervisor read access in kernel mode
> [    7.740125][    T1] #PF: error_code(0x0000) - not-present page
> [    7.741135][    T1] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
> [    7.742337][    T1] Oops: 0000 [#1]
> [    7.742986][    T1] CPU: 0 PID: 1 Comm: swapper Tainted: G S                 6.4.0-rc1-00077-g63ba4d67594a #2
> [    7.744804][    T1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
> [    7.746660][    T1] EIP: crypto_sig_verify+0x82/0xa4

---8<---
The request tfm needs to be set.

Fixes: addde1f2c966 ("crypto: akcipher - Add sync interface without SG lists")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202306261421.2ac744fa-oliver.sang@intel.com
diff mbox series

Patch

diff --git a/crypto/akcipher.c b/crypto/akcipher.c
index 152cfba1346c..8ffd31c44cf6 100644
--- a/crypto/akcipher.c
+++ b/crypto/akcipher.c
@@ -207,6 +207,7 @@  int crypto_akcipher_sync_prep(struct crypto_akcipher_sync_data *data)
 		return -ENOMEM;
 
 	data->req = req;
+	akcipher_request_set_tfm(req, data->tfm);
 
 	buf = (u8 *)(req + 1) + reqsize;
 	data->buf = buf;