[PATCH] char: hw_random: delete redundant printing of return value

2021-03-12 Thread Wang Qing
platform_get_irq() has already checked and printed the return value, the printing here is nothing special, it is not necessary at all. Signed-off-by: Wang Qing --- drivers/char/hw_random/cctrng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/cctrn

[PATCH v4 1/3] crypto: hisilicon/sec - fixes a printing error

2021-03-12 Thread Longfang Liu
When the log is output here, the device has not been initialized yet. Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_cry

[PATCH v4 3/3] crypto: hisilicon/sec - fixes some driver coding style

2021-03-12 Thread Longfang Liu
cleanup static check errors for SEC Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec_main.c | 131 ++- 1 file changed, 76 insertions(+), 55 deletions(-) diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c

[PATCH v4 2/3] crypto: hisilicon/sec - fixes some coding style

2021-03-12 Thread Longfang Liu
1.delete the original complex method of obtaining the current device and replace it with the initialized device pointer. 2.fixes some coding style Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec.h| 5 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 75 +++--

[PATCH v4 0/3] crypto:hisilicon/sec - fixes some coding style

2021-03-12 Thread Longfang Liu
1. Fix a problems. 2. Fix some coding style. Changes v3 -> v4: - Fixed an unused warning on dev. - Create a patch for bugfix Changes v2 -> v3: - Delete shash test error patch. Changes v1 -> v2: - Modify the way to fix shash test error. Longfang Liu (3): crypto: hisilicon/sec - fixes a

[PATCH] hwrng: ba431 - use devm_platform_ioremap_resource() to simplify

2021-03-12 Thread Tian Tao
Use devm_platform_ioremap_resource() to simplify the code. Signed-off-by: Tian Tao --- drivers/char/hw_random/ba431-rng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c index 4f514e2..5b7ca04 100644

[PATCH] hwrng: cctrn - use devm_platform_ioremap_resource() to simplify

2021-03-12 Thread Tian Tao
Use devm_platform_ioremap_resource() to simplify the code. Signed-off-by: Tian Tao --- drivers/char/hw_random/cctrng.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c index 7a293f2..e7f12953 100644

Re: [PATCH v3 1/2] crypto: hisilicon/sec - fixes some log printing style

2021-03-12 Thread liulongfang
On 2021/3/12 20:59, Herbert Xu wrote: > On Thu, Mar 04, 2021 at 02:18:54PM +0800, Longfang Liu wrote: >> >> @@ -727,7 +725,7 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, >> struct sec_req *req, >> struct aead_request *aead_req = req->aead_req.aead_req; >> struct sec_cipher_r

[PATCH v7 5/5] certs: Allow root user to append signed hashes to the blacklist keyring

2021-03-12 Thread Mickaël Salaün
From: Mickaël Salaün Add a kernel option SYSTEM_BLACKLIST_AUTH_UPDATE to enable the root user to dynamically add new keys to the blacklist keyring. This enables to invalidate new certificates, either from being loaded in a keyring, or from being trusted in a PKCS#7 certificate chain. This also

[PATCH v7 4/5] certs: Factor out the blacklist hash creation

2021-03-12 Thread Mickaël Salaün
From: Mickaël Salaün Factor out the blacklist hash creation with the get_raw_hash() helper. This also centralize the "tbs" and "bin" prefixes and make them private, which help to manage them consistently. Cc: David Howells Cc: David S. Miller Cc: David Woodhouse Cc: Eric Snowberg Cc: Herbert

[PATCH v7 2/5] certs: Check that builtin blacklist hashes are valid

2021-03-12 Thread Mickaël Salaün
From: Mickaël Salaün Add and use a check-blacklist-hashes.awk script to make sure that the builtin blacklist hashes set with CONFIG_SYSTEM_BLACKLIST_HASH_LIST will effectively be taken into account as blacklisted hashes. This is useful to debug invalid hash formats, and it make sure that previou

[PATCH v7 3/5] certs: Make blacklist_vet_description() more strict

2021-03-12 Thread Mickaël Salaün
From: Mickaël Salaün Before exposing this new key type to user space, make sure that only meaningful blacklisted hashes are accepted. This is also checked for builtin blacklisted hashes, but a following commit make sure that the user will notice (at built time) and will fix the configuration if

[PATCH v7 1/5] tools/certs: Add print-cert-tbs-hash.sh

2021-03-12 Thread Mickaël Salaün
From: Mickaël Salaün Add a new helper print-cert-tbs-hash.sh to generate a TBSCertificate hash from a given certificate. This is useful to generate a blacklist key description used to forbid loading a specific certificate in a keyring, or to invalidate a certificate provided by a PKCS#7 file. T

[PATCH v7 0/5] Enable root to update the blacklist keyring

2021-03-12 Thread Mickaël Salaün
This new patch series is a rebase on David Howells's and Eric Snowberg's keys-cve-2020-26541-v3. I successfully tested this patch series with the 186 entries from https://uefi.org/sites/default/files/resources/dbxupdate_x64.bin (184 binary hashes and 2 certificates). The goal of these patches is

Re: [PATCH v2 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Tong Zhang
Thanks Andy, I have sent v3 with the suggested tag fix. - Tong

[PATCH v3 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Tong Zhang
ADF_STATUS_PF_RUNNING is (only) used and checked by adf_vf2pf_shutdown() before calling adf_iov_putmsg()->mutex_lock(vf2pf_lock), however the vf2pf_lock is initialized in adf_dev_init(), which can fail and when it fail, the vf2pf_lock is either not initialized or destroyed, a subsequent use of vf2

[PATCH v3 1/2] crypto: qat - dont release uninitialized resources

2021-03-12 Thread Tong Zhang
adf_vf_isr_resource_alloc() is not unwinding correctly when error happens and it trys to release uninitialized resources. To fix this, only release initialized resources. [1.792845] Trying to free already-free IRQ 11 [1.793091] WARNING: CPU: 0 PID: 182 at kernel/irq/manage.c:1821 free_irq

[PATCH v3 0/2] crypto: qat: fix couple crashes duing error handling

2021-03-12 Thread Tong Zhang
There are a couple of issues in qat error handling. Those drivers tries to release resources that is not initialized. This patch series tries to fix crashes caused by incorrect error handling. v2: removed excessive dump in commit log as suggested by Andy Shevchenko v3: collect tags as suggested

Re: [PATCH v2 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Andy Shevchenko
On Fri, Mar 12, 2021 at 6:10 PM Tong Zhang wrote: > I am not really sure this reviewed by line should be added by me -- > IMHO from my past experience this line is added by the actual person > who reviewed it on a per-patch and version basis > I can send out another revision adding this Reviewed

Re: [PATCH v2 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Tong Zhang
Hi Andy, I am not really sure this reviewed by line should be added by me -- IMHO from my past experience this line is added by the actual person who reviewed it on a per-patch and version basis I can send out another revision adding this Reviewed-by line if you think this is something should be do

Re: [PATCH v2 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Andy Shevchenko
On Fri, Mar 12, 2021 at 5:48 PM Tong Zhang wrote: Please, do not top post when replying to the email. > Complete newbie here, could you please remind me of the tag you are > referring to? Reviewed-by IIRC. > I am not really familiar with the process. Have you read [1]? The chapters 11-13 refe

Re: [PATCH v2 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Tong Zhang
Hi Andy, Complete newbie here, could you please remind me of the tag you are referring to? I am not really familiar with the process. Thanks, - Tong On Fri, Mar 12, 2021 at 10:35 AM Andy Shevchenko wrote: > > On Fri, Mar 12, 2021 at 4:21 PM Tong Zhang wrote: > > > > ADF_STATUS_PF_RUNNING is (on

Re: [PATCH v2 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Andy Shevchenko
On Fri, Mar 12, 2021 at 4:21 PM Tong Zhang wrote: > > ADF_STATUS_PF_RUNNING is (only) used and checked by adf_vf2pf_shutdown() > before calling adf_iov_putmsg()->mutex_lock(vf2pf_lock), however the > vf2pf_lock is initialized in adf_dev_init(), which can fail and when it > fail, the vf2pf_lock is

Re: [PATCH 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Tong Zhang
Hi Andy, Thanks for the suggestion. I have removed excessive lines in the commit log and sent out a v2 patch. Thanks again. - Tong On Fri, Mar 12, 2021 at 3:56 AM Andy Shevchenko wrote: > > On Fri, Mar 12, 2021 at 9:50 AM Tong Zhang wrote: > > > > ADF_STATUS_PF_RUNNING is (only) used and checked

[PATCH v2 1/2] crypto: qat - dont release uninitialized resources

2021-03-12 Thread Tong Zhang
adf_vf_isr_resource_alloc() is not unwinding correctly when error happens and it trys to release uninitialized resources. To fix this, only release initialized resources. [1.792845] Trying to free already-free IRQ 11 [1.793091] WARNING: CPU: 0 PID: 182 at kernel/irq/manage.c:1821 free_irq

[PATCH v2 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Tong Zhang
ADF_STATUS_PF_RUNNING is (only) used and checked by adf_vf2pf_shutdown() before calling adf_iov_putmsg()->mutex_lock(vf2pf_lock), however the vf2pf_lock is initialized in adf_dev_init(), which can fail and when it fail, the vf2pf_lock is either not initialized or destroyed, a subsequent use of vf2

[PATCH v2 0/2] crypto: qat: fix couple crashes duing error handling

2021-03-12 Thread Tong Zhang
There are a couple of issues in qat error handling. Those drivers tries to release resources that is not initialized. This patch series tries to fix crashes caused by incorrect error handling. v2: removed excessive dump in commit log Tong Zhang (2): crypto: qat - dont release uninitialized reso

Re: [PATCH v6 0/3] hwrng: bcm2835: add reset support

2021-03-12 Thread Herbert Xu
On Fri, Mar 05, 2021 at 08:01:29AM +0100, Álvaro Fernández Rojas wrote: > Some devices may need to perform a reset before using the RNG, such as the > BCM6368. > > v6: fix dt-bindings documentation, add patch makings clocks mandatory for > BCM6368. > v5: remove reset_control_rearm() and apply on

Re: [PATCH] crypto: sun4i-ss - simplify optional reset handling

2021-03-12 Thread Herbert Xu
On Fri, Mar 05, 2021 at 10:12:36AM +0100, Philipp Zabel wrote: > As of commit bb475230b8e5 ("reset: make optional functions really > optional"), the reset framework API calls use NULL pointers to describe > optional, non-present reset controls. > > This allows to unconditionally return errors from

Re: [PATCH v2 0/2] crypto: qat - fixes related to 'dma_map_single'

2021-03-12 Thread Herbert Xu
On Fri, Mar 05, 2021 at 02:35:00PM +0800, Hui Tang wrote: > This patchset fix bugs related to 'dma_map_single' use: > > Hui Tang (2): > crypto: qat - fix 'dma_unmap_single' invalid address > crypto: qat - fix use of 'dma_map_single' > > > v1 -> v2: > 1.fix build warning reported by ker

Re: [PATCH] crypto: allwinner: sun8i-ce: fix error return code in sun8i_ce_prng_generate()

2021-03-12 Thread Herbert Xu
On Thu, Mar 04, 2021 at 05:57:17PM -0800, Jia-Ju Bai wrote: > When dma_mapping_error() returns an error, no error return code of > sun8i_ce_prng_generate() is assigned. > To fix this bug, err is assigned with -EFAULT as error return code. > > Reported-by: TOTE Robot > Signed-off-by: Jia-Ju Bai

Re: [PATCH v10 0/7] add ECDH and CURVE25519 algorithms support for Kunpeng 930

2021-03-12 Thread Herbert Xu
On Thu, Mar 04, 2021 at 02:35:43PM +0800, Meng Yu wrote: > 1. Move curve ID from the key into the algorithm name (like 'ecdh-nist-pxxx' >so we get its tfm like 'crypto_alloc_kpp("ecdh-nist-p256", 0, 0)'), >in 'crypto/ecc.c' (has been verified by testmgr) and 'crypto/atmel-ecc.c' >(only

Re: [PATCH] crypto: ccp - Don't initialize SEV support without the SEV feature

2021-03-12 Thread Herbert Xu
On Wed, Mar 03, 2021 at 04:31:09PM -0600, Tom Lendacky wrote: > From: Tom Lendacky > > If SEV has been disabled (e.g. through BIOS), the driver probe will still > issue SEV firmware commands. The SEV INIT firmware command will return an > error in this situation, but the error code is a general e

Re: [PATCH v3] crypto: api - check for ERR pointers in crypto_destroy_tfm()

2021-03-12 Thread Herbert Xu
On Tue, Mar 02, 2021 at 09:33:03PM +0100, Ard Biesheuvel wrote: > Given that crypto_alloc_tfm() may return ERR pointers, and to avoid > crashes on obscure error paths where such pointers are presented to > crypto_destroy_tfm() (such as [0]), add an ERR_PTR check there > before dereferencing the sec

Re: [PATCH] crypto: sun8i-ss: Fix memory leak of object d when dma_iv fails to map

2021-03-12 Thread Herbert Xu
On Tue, Mar 02, 2021 at 04:34:46PM +, Colin King wrote: > From: Colin Ian King > > In the case where the dma_iv mapping fails, the return error path leaks > the memory allocated to object d. Fix this by adding a new error return > label and jumping to this to ensure d is free'd before the re

Re: [PATCH] hwrng: pic32 - Use device-managed registration API

2021-03-12 Thread Herbert Xu
On Mon, Mar 01, 2021 at 11:24:53AM +0800, Tian Tao wrote: > Use devm_hwrng_register to get rid of manual unregistration. > > Signed-off-by: Tian Tao > --- > drivers/char/hw_random/pic32-rng.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu

Re: [PATCH] hwrng: cctrng - Use device-managed registration API

2021-03-12 Thread Herbert Xu
On Mon, Mar 01, 2021 at 10:43:48AM +0800, Tian Tao wrote: > Use devm_hwrng_register to get rid of manual unregistration. > > Signed-off-by: Tian Tao > --- > drivers/char/hw_random/cctrng.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu

Re: [PATCH] crypto: cavium - remove unused including

2021-03-12 Thread Herbert Xu
On Mon, Mar 01, 2021 at 11:54:12AM +0800, Tian Tao wrote: > Remove including that don't need it. > > Signed-off-by: Tian Tao > --- > drivers/crypto/cavium/cpt/cptpf_main.c | 1 - > 1 file changed, 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.a

Re: [PATCH 0/7] Add support for AEAD algorithms in Qualcomm Crypto Engine driver

2021-03-12 Thread Herbert Xu
On Thu, Mar 04, 2021 at 01:41:15PM -0500, Thara Gopinath wrote: > > Yes it did. The last patch adds fallback for unsupported cases and > this will make it pass the fuzz tests. Please include this information in the next round. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~

Re: [PATCH 4/7] crypto: qce: Add support for AEAD algorithms

2021-03-12 Thread Herbert Xu
On Thu, Feb 25, 2021 at 01:27:13PM -0500, Thara Gopinath wrote: > > +static int > +qce_aead_async_req_handle(struct crypto_async_request *async_req) > +{ > + struct aead_request *req = aead_request_cast(async_req); > + struct qce_aead_reqctx *rctx = aead_request_ctx(req); > + struct cry

Re: [PATCH v3 1/2] crypto: hisilicon/sec - fixes some log printing style

2021-03-12 Thread Herbert Xu
On Thu, Mar 04, 2021 at 02:18:54PM +0800, Longfang Liu wrote: > > @@ -727,7 +725,7 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, > struct sec_req *req, > struct aead_request *aead_req = req->aead_req.aead_req; > struct sec_cipher_req *c_req = &req->c_req; > struct sec

Re: [PATCH 0/2] crypto: qat: fix couple crashes duing error handling

2021-03-12 Thread Andy Shevchenko
On Fri, Mar 12, 2021 at 02:43:56AM -0500, Tong Zhang wrote: > There are a couple of issues in qat error handling. Those drivers tries to > release resources that is not initialized. This patch series tries to fix > crashes caused by incorrect error handling. Please, in this series and everywhere e

Re: [PATCH] crypto: sun8i-ss: fix result memory leak on error path

2021-03-12 Thread Herbert Xu
On Tue, Mar 02, 2021 at 05:41:45PM +0100, Corentin Labbe wrote: > This patch fixes a memory leak on an error path. > > Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms") > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Signed-off-by: Corentin Labbe > --- > driver

Re: [PATCH 2/2] crypto: qat: ADF_STATUS_PF_RUNNING should be set after adf_dev_init

2021-03-12 Thread Andy Shevchenko
On Fri, Mar 12, 2021 at 9:50 AM Tong Zhang wrote: > > ADF_STATUS_PF_RUNNING is (only) used and checked by adf_vf2pf_shutdown() > before calling adf_iov_putmsg()->mutex_lock(vf2pf_lock), however the > vf2pf_lock is initialized in adf_dev_init(), which can fail and when it > fail, the vf2pf_lock is