linux-stable/drivers/crypto
Sean Anderson aad29a00a5 crypto: mxs-dcp - Use sg_mapping_iter to copy data
[ Upstream commit 2e6d793e1b ]

This uses the sg_pcopy_from_buffer to copy data, instead of doing it
ourselves.

In addition to reducing code size, this fixes the following oops
resulting from failing to kmap the page:

[   68.896381] Unable to handle kernel NULL pointer dereference at virtual address 00000ab8
[   68.904539] pgd = 3561adb3
[   68.907475] [00000ab8] *pgd=00000000
[   68.911153] Internal error: Oops: 805 [#1] ARM
[   68.915618] Modules linked in: cfg80211 rfkill des_generic libdes arc4 libarc4 cbc ecb algif_skcipher sha256_generic libsha256 sha1_generic hmac aes_generic libaes cmac sha512_generic md5 md4 algif_hash af_alg i2c_imx i2c_core ci_hdrc_imx ci_hdrc mxs_dcp ulpi roles udc_core imx_sdma usbmisc_imx usb_common firmware_class virt_dma phy_mxs_usb nf_tables nfnetlink ip_tables x_tables ipv6 autofs4
[   68.950741] CPU: 0 PID: 139 Comm: mxs_dcp_chan/ae Not tainted 5.10.34 #296
[   68.958501] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[   68.964710] PC is at memcpy+0xa8/0x330
[   68.968479] LR is at 0xd7b2bc9d
[   68.971638] pc : [<c053e7c8>]    lr : [<d7b2bc9d>]    psr: 000f0013
[   68.977920] sp : c2cbbee4  ip : 00000010  fp : 00000010
[   68.983159] r10: 00000000  r9 : c3283a40  r8 : 1a5a6f08
[   68.988402] r7 : 4bfe0ecc  r6 : 76d8a220  r5 : c32f9050  r4 : 00000001
[   68.994945] r3 : 00000ab8  r2 : fffffff0  r1 : c32f9050  r0 : 00000ab8
[   69.001492] Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   69.008646] Control: 10c53c7d  Table: 83664059  DAC: 00000051
[   69.014414] Process mxs_dcp_chan/ae (pid: 139, stack limit = 0x667b57ab)
[   69.021133] Stack: (0xc2cbbee4 to 0xc2cbc000)
[   69.025519] bee0:          c32f9050 c3235408 00000010 00000010 00000ab8 00000001 bf10406c
[   69.033720] bf00: 00000000 00000000 00000010 00000000 c32355d0 832fb080 00000000 c13de2fc
[   69.041921] bf20: c3628010 00000010 c33d5780 00000ab8 bf1067e8 00000002 c21e5010 c2cba000
[   69.050125] bf40: c32f8040 00000000 bf106a40 c32f9040 c3283a80 00000001 bf105240 c3234040
[   69.058327] bf60: ffffe000 c3204100 c2c69800 c2cba000 00000000 bf103b84 00000000 c2eddc54
[   69.066530] bf80: c3204144 c0140d1c c2cba000 c2c69800 c0140be8 00000000 00000000 00000000
[   69.074730] bfa0: 00000000 00000000 00000000 c0100114 00000000 00000000 00000000 00000000
[   69.082932] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   69.091131] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[   69.099364] [<c053e7c8>] (memcpy) from [<bf10406c>] (dcp_chan_thread_aes+0x4e8/0x840 [mxs_dcp])
[   69.108117] [<bf10406c>] (dcp_chan_thread_aes [mxs_dcp]) from [<c0140d1c>] (kthread+0x134/0x160)
[   69.116941] [<c0140d1c>] (kthread) from [<c0100114>] (ret_from_fork+0x14/0x20)
[   69.124178] Exception stack(0xc2cbbfb0 to 0xc2cbbff8)
[   69.129250] bfa0:                                     00000000 00000000 00000000 00000000
[   69.137450] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   69.145648] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   69.152289] Code: e320f000 e4803004 e4804004 e4805004 (e4806004)

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-18 13:40:17 +02:00
..
allwinner crypto: sun8i-ss - Fix memory leak of pad 2021-05-14 09:50:17 +02:00
amcc crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd 2020-12-30 11:53:17 +01:00
amlogic crypto: amlogic - Convert to DEFINE_SHOW_ATTRIBUTE 2020-09-25 17:48:16 +10:00
axis treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
bcm crypto: bcm - Rename struct device_private to bcm_device_private 2021-03-04 11:37:40 +01:00
caam crypto: caam - fix printing on xts fallback allocation error path 2020-12-30 11:53:03 +01:00
cavium crypto: nitrox - fix unchecked variable in nitrox_register_interrupts 2021-07-14 16:56:06 +02:00
ccp crypto: ccp - shutdown SEV firmware on kexec 2021-09-18 13:40:09 +02:00
ccree crypto: ccree - Simplify with dev_err_probe() 2020-09-04 17:57:16 +10:00
chelsio crypto: chelsio - Read rxchannel-id from firmware 2021-05-14 09:50:19 +02:00
hisilicon crypto: hisilicon/sec - fixup 3des minimum key size declaration 2021-07-14 16:55:53 +02:00
inside-secure crypto: inside-secure - Fix sizeof() mismatch 2020-12-30 11:53:00 +01:00
marvell crypto: marvel/cesa - Fix tdma descriptor on 64-bit 2021-02-03 23:28:40 +01:00
mediatek crypto: mediatek - simplify the return expression of mtk_dfe_dse_reset() 2020-10-02 18:02:10 +10:00
nx crypto: nx - Fix RCU warning in nx842_OF_upd_status 2021-07-14 16:56:10 +02:00
qat crypto: qat - use proper type for vf_mask 2021-09-15 09:50:29 +02:00
qce crypto: qce - fix error return code in qce_skcipher_async_req_handle() 2021-07-14 16:56:54 +02:00
rockchip crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
stm32 crypto: stm32/cryp - Fix PM reference leak on stm32-cryp.c 2021-05-11 14:47:21 +02:00
ux500 crypto: ux500 - Fix error return code in hash_hw_final() 2021-07-14 16:56:03 +02:00
virtio crypto: virtio - don't use 'default m' 2020-08-21 14:47:50 +10:00
vmx powerpc: Replace HTTP links with HTTPS ones 2020-07-22 00:01:23 +10:00
xilinx crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
atmel-aes-regs.h
atmel-aes.c crypto: atmel-aes - convert to use be32_add_cpu() 2020-09-25 17:48:12 +10:00
atmel-authenc.h
atmel-ecc.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
atmel-i2c.c
atmel-i2c.h
atmel-sha-regs.h
atmel-sha.c crypto: lib/sha1 - remove unnecessary includes of linux/cryptohash.h 2020-05-08 15:32:17 +10:00
atmel-sha204a.c
atmel-tdes-regs.h
atmel-tdes.c crypto: atmel-tdes - use semicolons rather than commas to separate statements 2020-10-02 18:02:15 +10:00
exynos-rng.c
geode-aes.c
geode-aes.h
hifn_795x.c crypto: drivers - use semicolons rather than commas to separate statements 2020-10-02 18:02:15 +10:00
img-hash.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
ixp4xx_crypto.c crypto: ixp4xx - update IV after requests 2021-07-14 16:56:03 +02:00
Kconfig crypto: omap-sham - Fix link error without crypto-engine 2021-01-27 11:55:06 +01:00
Makefile crypto: sa2ul - Add crypto driver 2020-07-23 17:34:16 +10:00
mxs-dcp.c crypto: mxs-dcp - Use sg_mapping_iter to copy data 2021-09-18 13:40:17 +02:00
n2_asm.S
n2_core.c crypto: n2 - Fix sparse endianness warning 2020-09-18 17:20:12 +10:00
n2_core.h
omap-aes-gcm.c crypto: omap-aes - avoid spamming console with self tests 2020-06-04 22:03:39 +10:00
omap-aes.c crypto: omap - Fix inconsistent locking of device lists 2021-09-15 09:50:26 +02:00
omap-aes.h crypto: omap-aes - permit asynchronous skcipher as fallback 2020-07-16 21:49:02 +10:00
omap-crypto.c crypto: omap-crypto - fix userspace copied buffer access 2020-06-04 22:03:40 +10:00
omap-crypto.h
omap-des.c crypto: omap - Fix inconsistent locking of device lists 2021-09-15 09:50:26 +02:00
omap-sham.c crypto: omap - Fix inconsistent locking of device lists 2021-09-15 09:50:26 +02:00
padlock-aes.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
padlock-sha.c
picoxcell_crypto.c crypto: picoxcell - Fix potential race condition bug 2020-08-21 14:47:50 +10:00
picoxcell_crypto_regs.h
qcom-rng.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
s5p-sss.c crypto: s5p-sss - Pass error from clk_get and reduce verbosity on deferral 2020-09-11 14:39:17 +10:00
sa2ul.c crypto: sa2ul - Fix pm_runtime enable in sa_ul_probe() 2021-07-14 16:56:04 +02:00
sa2ul.h crypto: sa2ul - Add AEAD algorithm support 2020-07-23 17:34:17 +10:00
sahara.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
talitos.c crypto: talitos - Fix ctr(aes) on SEC1 2021-03-04 11:37:45 +01:00
talitos.h crypto: talitos - Work around SEC6 ERRATA (AES-CTR mode data size error) 2021-03-04 11:37:45 +01:00