[PATCH -next] crypto: sa2ul - fix wrong pointer passed to PTR_ERR()

2020-07-24 Thread Wei Yongjun
PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned. Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/crypto/sa2ul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 2/4] crypto: hisilicon/zip - fix zero length input in GZIP decompress

2020-07-24 Thread Yang Shen
From: Zhou Wang The zero length input will cause a call trace when use GZIP decompress like this: Unable to handle kernel paging request at virtual address ... lr : get_gzip_head_size+0x7c/0xd0 [hisi_zip] Judge the input length and return '-EINVAL' when input is invalid.

[PATCH 4/4] crypto: hisilicon/zip - fix the uninitalized 'curr_qm_qp_num'

2020-07-24 Thread Yang Shen
From: Sihang Chen The 'qm->curr_qm_qp_num' is not initialized, which will result in failure to write the current_q file. Signed-off-by: Sihang Chen Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/

[PATCH 3/4] crypto: hisilicon/zip - fix the return value when device is busy

2020-07-24 Thread Yang Shen
As before, when the ZIP device is too busy to creat a request, it will return '-EBUSY'. But the crypto process think the '-EBUSY' means a successful request and wait for its completion. So replace '-EBUSY' with '-EAGAIN' to show crypto this request is failed. Fixes: 62c455ca853e("crypto: hisilico

[PATCH 0/4] crypto: hisilicon/zip - misc bugfix

2020-07-24 Thread Yang Shen
This patchset fix some bug: patch 1:clear the debug registers when remove driver patch 2:intercept invalid input when using decompress patch 3:replace the return value '-EBUSY' with '-EAGAIN' when device is busy patch 4:initialize the 'curr_qm_qp_num' when probe device This patchset depends on

[PATCH 1/4] crypto: hisilicon/zip - fix the uncleared debug registers

2020-07-24 Thread Yang Shen
From: Hao Fang ZIP debug registers aren't cleared even if its driver is removed, so add a clearing operation when remove driver. Signed-off-by: Hao Fang Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_main.c | 18 ++ 1 file changed, 18 ins

[PATCH 03/10] crypto: hisilicon/zip - modify debugfs interface parameters

2020-07-24 Thread Yang Shen
From: Shukun Tan Update debugfs interface parameters Signed-off-by: Shukun Tan Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_main.c | 55 ++--- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/drivers/crypto/hi

[PATCH 10/10] crypto: hisilicon/zip - fix some coding styles

2020-07-24 Thread Yang Shen
1.Unified alignment styles 2.Remove unnecessary goto branch 3.Remove address printf Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_crypto.c | 13 ++--- drivers/crypto/hisilicon/zip/zip_main.c | 16 2 files changed, 10 insertions(+

[PATCH 05/10] crypto: hisilicon/zip - use a enum parameter instead of some macros

2020-07-24 Thread Yang Shen
Macros 'QPC_COMP', 'QPC_DECOMP' and 'HZIP_CTX_Q_NUM' are relative and incremental. So, use an enum instead. Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_crypto.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a

[PATCH 02/10] crypto: hisilicon/zip - unify naming style for functions and macros

2020-07-24 Thread Yang Shen
1.Add prefix 'HZIP' for some macros 2.Add prefix 'hisi_zip' for some functions Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_main.c | 35 + 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/crypto/hisil

[PATCH 09/10] crypto: hisilicon/zip - supplement some comments

2020-07-24 Thread Yang Shen
Supplement some comments. Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c index 7697fa5..49fad18

[PATCH 01/10] crypto: hisilicon/zip - remove some useless parameters

2020-07-24 Thread Yang Shen
1.Remove the macro 'HZIP_VF_NUM'. 2.Remove 'list' of the struct 'hisi_zip' Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip.h | 1 - drivers/crypto/hisilicon/zip/zip_main.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/crypto/hisilicon/zip

[PATCH 06/10] crypto: hisilicon/zip - add print for error branch

2020-07-24 Thread Yang Shen
Add print for some error branches. Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_crypto.c | 68 +++ drivers/crypto/hisilicon/zip/zip_main.c | 8 ++-- 2 files changed, 56 insertions(+), 20 deletions(-) diff --git a/drivers/cr

[PATCH 04/10] crypto: hisilicon/zip - replace 'sprintf' with 'scnprintf'

2020-07-24 Thread Yang Shen
Replace 'sprintf' with 'scnprintf' to avoid overrun. Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_main.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zi

[PATCH 00/10] crypto: hisilicon/zip - misc clean up

2020-07-24 Thread Yang Shen
This patchset make some clean up: patch 1:remove useless parameters patch 4:replace 'sprintf' with 'scnprintf' patch 7:fix static check warning and the rest patch fix some coding style This patchset depends on: https://patchwork.kernel.org/cover/11680181/ Shukun Tan (1): crypto: hisilicon/zip -

[PATCH 08/10] crypto: hisilicon/zip - move some private macros from 'zip.h' to 'zip_crypto.c'

2020-07-24 Thread Yang Shen
Some macros which are defined in 'zip.h' are related to the struct 'hisi_zip_sqe' and are only used in 'zip_crypto.c'. So move them from 'zip.h' to 'zip_crypto.c'. Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip.h| 14 -- drivers/crypto/h

[PATCH 07/10] crypto: hisilicon/zip - fix static check warning

2020-07-24 Thread Yang Shen
Fix some code for PClint warning: Warning - Suspicious Cast Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_crypto.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/cry

Re: [PATCH 2/4] drivers: crypto: add support for OCTEONTX2 CPT engine

2020-07-24 Thread David Miller
From: Srujana Challa Date: Fri, 24 Jul 2020 18:38:02 +0530 > diff --git a/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h > b/drivers/crypto/marvell/octeontx2/otx2_cpt_common.h > new file mode 100644 > index 000..00cd534 > --- /dev/null > +++ b/drivers/crypto/marvell/octeontx2/otx2_cpt_co

Re: [PATCH 4/4] crypto: marvell: enable OcteonTX2 cpt options for build

2020-07-24 Thread kernel test robot
Hi Srujana, I love your patch! Yet something to improve: [auto build test ERROR on cryptodev/master] [also build test ERROR on crypto/master sparc-next/master linus/master v5.8-rc6 next-20200724] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch

Re: get rid of the address_space override in setsockopt v2

2020-07-24 Thread David Miller
From: Christoph Hellwig Date: Thu, 23 Jul 2020 08:08:42 +0200 > setsockopt is the last place in architecture-independ code that still > uses set_fs to force the uaccess routines to operate on kernel pointers. > > This series adds a new sockptr_t type that can contained either a kernel > or user

Re: [PATCH 4/4] crypto: marvell: enable OcteonTX2 cpt options for build

2020-07-24 Thread kernel test robot
Hi Srujana, I love your patch! Yet something to improve: [auto build test ERROR on cryptodev/master] [also build test ERROR on crypto/master sparc-next/master linus/master v5.8-rc6 next-20200724] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch

Re: [PATCH v3 3/5] crypto: DH - check validity of Z before export

2020-07-24 Thread Neil Horman
On Mon, Jul 20, 2020 at 07:08:32PM +0200, Stephan Müller wrote: > SP800-56A rev3 section 5.7.1.1 step 2 mandates that the validity of the > calculated shared secret is verified before the data is returned to the > caller. This patch adds the validation check. > > Signed-off-by: Stephan Mueller >

Re: [PATCH v3 1/5] crypto: ECDH - check validity of Z before export

2020-07-24 Thread Neil Horman
On Mon, Jul 20, 2020 at 07:07:48PM +0200, Stephan Müller wrote: > SP800-56A rev3 section 5.7.1.2 step 2 mandates that the validity of the > calculated shared secret is verified before the data is returned to the > caller. Thus, the export function and the validity check functions are > reversed. In

[PATCH][next] crypto: sa2ul - Fix inconsistent IS_ERR and PTR_ERR

2020-07-24 Thread Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in sa_dma_init(). The proper pointer to be passed as argument to PTR_ERR() is dd->dma_tx. This bug was detected with the help of Coccinelle. Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver") Signed-off-by: Gustavo A. R. Silva --- drivers/crypto/sa2ul.

Re: [PATCHv2 2/2] hwrng: optee: fix wait use case

2020-07-24 Thread Jorge Ramirez-Ortiz, Foundries
On 24/07/20, Sumit Garg wrote: > On Thu, 23 Jul 2020 at 14:16, Jorge Ramirez-Ortiz wrote: > > > > The current code waits for data to be available before attempting a > > second read. However the second read would not be executed as the > > while loop exits. > > > > This fix does not wait if all da

Re: [PATCH] powerpc: Replace HTTP links with HTTPS ones

2020-07-24 Thread Michael Ellerman
On Sat, 18 Jul 2020 12:39:58 +0200, Alexander A. Klimov wrote: > Rationale: > Reduces attack surface on kernel devs opening the links for MITM > as HTTPS traffic is much harder to manipulate. > > Deterministic algorithm: > For each file: > If not .svg: > For each line: > If doesn't con

Re: [PATCHv2 1/2] hwrng: optee: handle unlimited data rates

2020-07-24 Thread Sumit Garg
On Thu, 23 Jul 2020 at 14:16, Jorge Ramirez-Ortiz wrote: > > Data rates of MAX_UINT32 will schedule an unnecessary one jiffy > timeout on the call to msleep. Avoid this scenario by using 0 as the > unlimited data rate. > > Signed-off-by: Jorge Ramirez-Ortiz > --- > drivers/char/hw_random/optee-r

Re: [PATCHv2 2/2] hwrng: optee: fix wait use case

2020-07-24 Thread Sumit Garg
On Thu, 23 Jul 2020 at 14:16, Jorge Ramirez-Ortiz wrote: > > The current code waits for data to be available before attempting a > second read. However the second read would not be executed as the > while loop exits. > > This fix does not wait if all data has been read and reads a second > time if

[PATCH 4/4] crypto: marvell: enable OcteonTX2 cpt options for build

2020-07-24 Thread Srujana Challa
Add OcteonTX2 cpt options in crypto Kconfig and Makefile Signed-off-by: Srujana Challa --- drivers/crypto/marvell/Kconfig| 17 + drivers/crypto/marvell/Makefile | 1 + drivers/crypto/marvell/octeontx2/Makefile | 14 ++ 3 files changed, 32 insert

[PATCH 0/4] Add Support for Marvell OcteonTX2 Cryptographic

2020-07-24 Thread Srujana Challa
The following series adds support for Marvell Cryptographic Acceleration Unit(CPT) on OcteonTX2 CN96XX SoC. This series is tested with CRYPTO_EXTRA_TESTS enabled and CRYPTO_DISABLE_TESTS disabled. Srujana Challa (4): octeontx2-af: add support to manage the CPT unit drivers: crypto: add support

[PATCH 3/4] drivers: crypto: add the Virtual Function driver for OcteonTX2 CPT

2020-07-24 Thread Srujana Challa
Add support for the cryptographic accelerator unit virtual functions on OcteonTX2 96XX SoC. Signed-off-by: Srujana Challa --- .../crypto/marvell/octeontx2/otx2_cpt_hw_types.h |5 + drivers/crypto/marvell/octeontx2/otx2_cpt_reqmgr.h | 121 ++ drivers/crypto/marvell/octeontx2/otx2_cptlf.h

[PATCH 1/4] octeontx2-af: add support to manage the CPT unit

2020-07-24 Thread Srujana Challa
The Admin function (AF) manages hardware resources on the cryptographic acceleration unit(CPT). This patch adds a mailbox interface for PFs and VFs to configure hardware resources for cryptography and inline-ipsec. Signed-off-by: Srujana Challa --- drivers/net/ethernet/marvell/octeontx2/af/Makef

[PATCH 2/4] drivers: crypto: add support for OCTEONTX2 CPT engine

2020-07-24 Thread Srujana Challa
Add support for the cryptographic acceleration unit (CPT) on OcteonTX2 CN96XX SoC. Signed-off-by: Srujana Challa --- drivers/crypto/marvell/octeontx2/otx2_cpt_common.h | 53 + .../crypto/marvell/octeontx2/otx2_cpt_hw_types.h | 567 + .../marvell/octeontx2/otx2_cpt_mbox_common.c |

Re: [PATCH v5 0/5] vfio/pci: add denylist and disable qat

2020-07-24 Thread Andy Shevchenko
On Fri, Jul 24, 2020 at 1:59 PM Giovanni Cabiddu wrote: > > This patchset defines a denylist of devices in the vfio-pci module and adds > the current generation of Intel(R) QuickAssist devices to it as they are > not designed to run in an untrusted environment. > > By default, if a device is in th

[PATCH v5 2/5] vfio/pci: Add device denylist

2020-07-24 Thread Giovanni Cabiddu
Add denylist of devices that by default are not probed by vfio-pci. Devices in this list may be susceptible to untrusted application, even if the IOMMU is enabled. To be accessed via vfio-pci, the user has to explicitly disable the denylist. The denylist can be disabled via the module parameter di

[PATCH v5 3/5] vfio/pci: Add QAT devices to denylist

2020-07-24 Thread Giovanni Cabiddu
The current generation of Intel® QuickAssist Technology devices are not designed to run in an untrusted environment because of the following issues reported in the document "Intel® QuickAssist Technology (Intel® QAT) Software for Linux" (document number 336211-014): QATE-39220 - GEN - Intel® QAT A

[PATCH v5 5/5] crypto: qat - use PCI_VDEVICE

2020-07-24 Thread Giovanni Cabiddu
Build pci_device_id structure using the PCI_VDEVICE macro. This removes any references to the ADF_SYSTEM_DEVICE macro. Suggested-by: Andy Shevchenko Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe --- drivers/crypto/qat/qat_c3xxx/adf_drv.c | 7 ++- drivers/crypto/qat/qat_c3xx

[PATCH v5 4/5] crypto: qat - replace device ids defines

2020-07-24 Thread Giovanni Cabiddu
Replace device ids defined in the QAT drivers with the ones in include/linux/pci_ids.h. Signed-off-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe --- drivers/crypto/qat/qat_c3xxx/adf_drv.c| 6 +++--- drivers/crypto/qat/qat_c3xxxvf/adf_drv.c | 6 +++--- drivers/crypto/qat/qat

[PATCH v5 1/5] PCI: Add Intel QuickAssist device IDs

2020-07-24 Thread Giovanni Cabiddu
Add device IDs for the following Intel QuickAssist devices: DH895XCC, C3XXX and C62X. The defines in this patch are going to be referenced in two independent drivers, qat and vfio-pci. Signed-off-by: Giovanni Cabiddu Acked-by: Bjorn Helgaas Reviewed-by: Fiona Trahe --- include/linux/pci_ids.h

[PATCH v5 0/5] vfio/pci: add denylist and disable qat

2020-07-24 Thread Giovanni Cabiddu
This patchset defines a denylist of devices in the vfio-pci module and adds the current generation of Intel(R) QuickAssist devices to it as they are not designed to run in an untrusted environment. By default, if a device is in the denylist, the probe of vfio-pci fails. If a user wants to use a de

RE: [PATCH v4 0/5] vfio/pci: add denylist and disable qat

2020-07-24 Thread Trahe, Fiona
> -Original Message- > From: Cabiddu, Giovanni > Sent: Friday, July 24, 2020 9:48 AM > To: alex.william...@redhat.com; herb...@gondor.apana.org.au > Cc: coh...@redhat.com; nhor...@redhat.com; vdro...@redhat.com; > bhelg...@google.com; > Chambers, Mark A ; McFadden, Gordon > ; > Atta, A

[PATCH] hwrng: core: remove redundant initialization of variable ret

2020-07-24 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/char/hw_random/core.c |

Re: [PATCH v4 2/5] vfio/pci: Add device denylist

2020-07-24 Thread Cornelia Huck
On Fri, 24 Jul 2020 09:47:57 +0100 Giovanni Cabiddu wrote: > Add denylist of devices that by default are not probed by vfio-pci. > Devices in this list may be susceptible to untrusted application, even > if the IOMMU is enabled. To be accessed via vfio-pci, the user has to > explicitly disable th

[PATCH v4 2/5] vfio/pci: Add device denylist

2020-07-24 Thread Giovanni Cabiddu
Add denylist of devices that by default are not probed by vfio-pci. Devices in this list may be susceptible to untrusted application, even if the IOMMU is enabled. To be accessed via vfio-pci, the user has to explicitly disable the denylist. The denylist can be disabled via the module parameter di

[PATCH v4 1/5] PCI: Add Intel QuickAssist device IDs

2020-07-24 Thread Giovanni Cabiddu
Add device IDs for the following Intel QuickAssist devices: DH895XCC, C3XXX and C62X. The defines in this patch are going to be referenced in two independent drivers, qat and vfio-pci. Signed-off-by: Giovanni Cabiddu Acked-by: Bjorn Helgaas --- include/linux/pci_ids.h | 6 ++ 1 file change

[PATCH v4 3/5] vfio/pci: Add QAT devices to denylist

2020-07-24 Thread Giovanni Cabiddu
The current generation of Intel® QuickAssist Technology devices are not designed to run in an untrusted environment because of the following issues reported in the document "Intel® QuickAssist Technology (Intel® QAT) Software for Linux" (document number 336211-014): QATE-39220 - GEN - Intel® QAT A

[PATCH v4 5/5] crypto: qat - use PCI_VDEVICE

2020-07-24 Thread Giovanni Cabiddu
Build pci_device_id structure using the PCI_VDEVICE macro. This removes any references to the ADF_SYSTEM_DEVICE macro. Signed-off-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_c3xxx/adf_drv.c | 7 ++- drivers/crypto/qat/qat_c3xxxvf/adf_drv.c| 7 ++- drivers/crypto/qat/qat_c62x

[PATCH v4 4/5] crypto: qat - replace device ids defines

2020-07-24 Thread Giovanni Cabiddu
Replace device ids defined in the QAT drivers with the ones in include/linux/pci_ids.h. Signed-off-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_c3xxx/adf_drv.c| 6 +++--- drivers/crypto/qat/qat_c3xxxvf/adf_drv.c | 6 +++--- drivers/crypto/qat/qat_c62x/adf_drv.c

[PATCH v4 0/5] vfio/pci: add denylist and disable qat

2020-07-24 Thread Giovanni Cabiddu
This patchset defines a denylist of devices in the vfio-pci module and adds the current generation of Intel(R) QuickAssist devices to it as they are not designed to run in an untrusted environment. By default, if a device is in the denylist, the probe of vfio-pci fails. If a user wants to use a de

Re: [PATCH v3 2/5] vfio/pci: Add device denylist

2020-07-24 Thread Giovanni Cabiddu
On Thu, Jul 23, 2020 at 04:41:26PM -0600, Alex Williamson wrote: > On Thu, 23 Jul 2020 22:47:02 +0100 > Giovanni Cabiddu wrote: > > > Add denylist of devices that by default are not probed by vfio-pci. > > Devices in this list may be susceptible to untrusted application, even > > if the IOMMU is