提交 f2905c16 编写于 作者: K Kai Ye 提交者: JiangShui Yang

crypto: hisilicon/sec - delete the flag CRYPTO_ALG_ALLOCATES_MEMORY

mainline inclusion
from mainline-v5.19-rc1
commit 2d33f577
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I6DRLU
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2d33f5771b51

----------------------------------------------------------------------

Should not to uses the CRYPTO_ALG_ALLOCATES_MEMORY in SEC2. The SEC2
driver uses the pre-allocated buffers, including the src sgl pool, dst
sgl pool and other qp ctx resources. (e.g. IV buffer, mac buffer, key
buffer). The SEC2 driver doesn't allocate memory during request processing.
The driver only maps software sgl to allocated hardware sgl during I/O. So
here is fix it.
Signed-off-by: NKai Ye <yekai13@huawei.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NJiangShui Yang <yangjiangshui@h-partners.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
上级 5042b422
...@@ -2113,7 +2113,6 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req) ...@@ -2113,7 +2113,6 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req)
.cra_driver_name = "hisi_sec_"sec_cra_name,\ .cra_driver_name = "hisi_sec_"sec_cra_name,\
.cra_priority = SEC_PRIORITY,\ .cra_priority = SEC_PRIORITY,\
.cra_flags = CRYPTO_ALG_ASYNC |\ .cra_flags = CRYPTO_ALG_ASYNC |\
CRYPTO_ALG_ALLOCATES_MEMORY |\
CRYPTO_ALG_NEED_FALLBACK,\ CRYPTO_ALG_NEED_FALLBACK,\
.cra_blocksize = blk_size,\ .cra_blocksize = blk_size,\
.cra_ctxsize = sizeof(struct sec_ctx),\ .cra_ctxsize = sizeof(struct sec_ctx),\
...@@ -2366,7 +2365,6 @@ static int sec_aead_decrypt(struct aead_request *a_req) ...@@ -2366,7 +2365,6 @@ static int sec_aead_decrypt(struct aead_request *a_req)
.cra_driver_name = "hisi_sec_"sec_cra_name,\ .cra_driver_name = "hisi_sec_"sec_cra_name,\
.cra_priority = SEC_PRIORITY,\ .cra_priority = SEC_PRIORITY,\
.cra_flags = CRYPTO_ALG_ASYNC |\ .cra_flags = CRYPTO_ALG_ASYNC |\
CRYPTO_ALG_ALLOCATES_MEMORY |\
CRYPTO_ALG_NEED_FALLBACK,\ CRYPTO_ALG_NEED_FALLBACK,\
.cra_blocksize = blk_size,\ .cra_blocksize = blk_size,\
.cra_ctxsize = sizeof(struct sec_ctx),\ .cra_ctxsize = sizeof(struct sec_ctx),\
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册