Re: [Part2 PATCH v6.1 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-24 Thread Gary R Hook
tkov <b...@suse.de> Cc: Herbert Xu <herb...@gondor.apana.org.au> Cc: Gary Hook <gary.h...@amd.com> Cc: Tom Lendacky <thomas.lenda...@amd.com> Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Brijesh Singh <brije

Re: [Part2 PATCH v6 15/38] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-24 Thread Gary R Hook
-by: Borislav Petkov <b...@suse.de> Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> Acked-by: Gary R Hook <gary.h...@amd.com> --- drivers/crypto/ccp/psp-dev.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/crypto/ccp/psp-dev.c b/driv

Re: [Part2 PATCH v6 09/38] crypto: ccp: Build the AMD secure processor driver only with AMD CPU support

2017-10-24 Thread Gary R Hook
rijesh Singh <brijesh.si...@amd.com> Cc: Brijesh Singh <brijesh.si...@amd.com> Cc: Tom Lendacky <thomas.lenda...@amd.com> Cc: Gary Hook <gary.h...@amd.com> Cc: Herbert Xu <herb...@gondor.apana.org.au> Cc: "David S. Miller" <da...@davemloft.net> Cc: linux-crypto@vge

Re: [Part2 PATCH v6 10/38] crypto: ccp: Define SEV userspace ioctl and command id

2017-10-24 Thread Gary R Hook
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> Reviewed-by: Borislav Petkov <b...@suse.de> Acked-by: Gary R Hook <gary.h...@amd.com> --- include/uapi/linux/psp-sev.h | 113 +++ 1 file changed, 113 insertions(+) create mode 100644 i

[PATCH] iommu/amd - Set the device table entry PPR bit for IOMMU V2 devices

2017-12-20 Thread Gary R Hook
to support PPR for a particular endpoint device. Please see https://support.amd.com/TechDocs/48882_IOMMU.pdf for this revision of the AMD IOMMU specification. Signed-off-by: Gary R Hook <gary.h...@amd.com> --- drivers/iommu/amd_iommu.c | 20 +++- drivers/iommu/amd_iommu_t

Re: [PATCH] iommu/amd - Set the device table entry PPR bit for IOMMU V2 devices

2017-12-20 Thread Gary R Hook
Please ignore; sent to the wrong list. Mea culpa. On 12/20/2017 10:57 AM, Gary R Hook wrote: The AMD IOMMU specification Rev 3.00 (December 2016) introduces a new Enhanced PPR Handling Support (EPHSup) bit in the MMIO register offset 0030h (IOMMU Extended Feature Register). When EPHSup=1

Re: [PATCH v2] hwrng: Clean up RNG list when last hwrng is unregistered

2018-01-05 Thread Gary R Hook
On 12/15/2017 01:55 PM, Gary R Hook wrote: Commit 142a27f0a731 added support for a "best" RNG, and in doing so introduced a hang from rmmod/modprobe -r when the last RNG on the list was unloaded. When the hwrng list is depleted, return the global variables to their original state and

Re: [PATCH v2] hwrng: Clean up RNG list when last hwrng is unregistered

2018-01-08 Thread Gary R Hook
On 01/07/2018 11:05 PM, Herbert Xu wrote: On Fri, Jan 05, 2018 at 11:28:23AM -0600, Gary R Hook wrote: It may not have been obvious from the title but this fixes a bug which will impact the use of any HW RNG that is the only RNG registered. The breakage of rmmod/modprobe -r that this fix

Re: [PATCH] crypto: ccp: Check for NULL PSP pointer at module unload

2018-07-26 Thread Gary R Hook
pointer. Add a pointer check of the psp_data field in the sp_device struct in psp_dev_destroy() and return immediately if it is NULL. Cc: # 4.16.x- Fixes: 2a6170dfe755 ("crypto: ccp: Add Platform Security Processor (PSP) device support") Signed-off-by: Tom Lendacky Acked-by: G

Re: [PATCH v1 4/5] crypto: ccp: Support register differences between PSP devices

2018-07-05 Thread Gary R Hook
-by: Gary R Hook --- drivers/crypto/ccp/psp-dev.c | 24 drivers/crypto/ccp/psp-dev.h |9 - drivers/crypto/ccp/sp-dev.h |7 ++- drivers/crypto/ccp/sp-pci.c |7 ++- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers

Re: [PATCH v1 3/5] crypto: ccp: Remove unused #defines

2018-07-05 Thread Gary R Hook
On 07/03/2018 12:11 PM, Tom Lendacky wrote: Remove some unused #defines for register offsets that are not used. This will lessen the changes required when register offsets change between versions of the device. Signed-off-by: Tom Lendacky Acked-by: Gary R Hook --- drivers/crypto/ccp/psp

Re: [PATCH v1 2/5] crypto: ccp: Add psp enabled message when initialization succeeds

2018-07-05 Thread Gary R Hook
On 07/03/2018 12:11 PM, Tom Lendacky wrote: Add a dev_notice() message to the PSP initialization to report when the PSP initialization has succeeded and the PSP is enabled. Signed-off-by: Tom Lendacky Acked-by: Gary R Hook --- drivers/crypto/ccp/psp-dev.c |2 ++ 1 file changed, 2

Re: [PATCH v1 1/5] crypto: ccp: Fix command completion detection race

2018-07-05 Thread Gary R Hook
pport") Cc: # 4.16.x- Signed-off-by: Tom Lendacky Acked-by: Gary R Hook --- drivers/crypto/ccp/psp-dev.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index ff478d8..973d683 100644 --- a/drivers/cryp

Re: [PATCH v1 5/5] crypto: ccp: Add support for new CCP/PSP device ID

2018-07-05 Thread Gary R Hook
On 07/03/2018 12:12 PM, Tom Lendacky wrote: Add a new CCP/PSP PCI device ID and new PSP register offsets. Signed-off-by: Tom Lendacky Acked-by: Gary R Hook --- drivers/crypto/ccp/sp-pci.c | 29 - 1 file changed, 24 insertions(+), 5 deletions(-) diff --git

Re: [PATCH v1 1/5] crypto: ccp: Fix command completion detection race

2018-07-05 Thread Gary R Hook
ecure Encrypted Virtualization (SEV) command support") Cc: # 4.16.x- Signed-off-by: Tom Lendacky --- Reviewed-by: Brijesh Singh Acked-by: Gary R Hook   drivers/crypto/ccp/psp-dev.c |    4 ++--   1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/p

Re: [PATCH] crypto/ccp: don't disable interrupts while setting up debugfs

2018-02-27 Thread Gary R Hook
On 02/26/2018 02:35 AM, Sebastian Andrzej Siewior wrote: On 2018-02-25 21:04:27 [-0500], Hook, Gary wrote: On 2/23/2018 5:33 PM, Sebastian Andrzej Siewior wrote: I don't why we need take a single write lock and disable interrupts while setting up debugfs. This is what what happens when we try

Re: Can a driver->probe be called for two devices at the same time (WAS: Re: [PATCH] crypto/ccp: don't disable interrupts while setting up debugfs)

2018-02-27 Thread Gary R Hook
On 02/27/2018 11:33 AM, Sebastian Andrzej Siewior wrote: On 2018-02-27 11:08:56 [-0600], Gary R Hook wrote: That issue remains unclear to me: Are probes of PCI devices guaranteed to be serialized? Observations on my CCPs says that they occur in order, but I don't know for certain

Re: [PATCH 2/3] crypto: ccp - return an actual key size from RSA max_size callback

2018-02-28 Thread Gary R Hook
Acked-by: Gary R Hook <gary.h...@amd.com> Fixes: ceeec0afd684 ("crypto: ccp - Add support for RSA on the CCP") Cc: sta...@vger.kernel.org --- drivers/crypto/ccp/ccp-crypto-rsa.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccp/ccp-c

Re: [PATCH 3/3] crypto: ccp - protect RSA implementation from too large input data

2018-02-28 Thread Gary R Hook
On 02/24/2018 10:03 AM, Maciej S. Szmigiero wrote: CCP RSA implementation uses a hardware input buffer which size depends only on the current RSA key length. Key modulus and a message to be processed is then copied to this buffer based on their own lengths. Since the price for providing too

Re: Can a driver->probe be called for two devices at the same time (WAS: Re: [PATCH] crypto/ccp: don't disable interrupts while setting up debugfs)

2018-02-27 Thread Gary R Hook
On 02/27/2018 01:36 PM, Sebastian Andrzej Siewior wrote: On 2018-02-27 19:40:34 [+0100], Greg Kroah-Hartman wrote: On Tue, Feb 27, 2018 at 06:33:14PM +0100, Sebastian Andrzej Siewior wrote: On 2018-02-27 11:08:56 [-0600], Gary R Hook wrote: That issue remains unclear to me: Are probes of PCI

[PATCH] crypto/ccp: Validate buffer lengths for copy operations

2018-03-07 Thread Gary R Hook
The CCP driver copies data between scatter/gather lists and DMA buffers. The length of the requested copy operation must be checked against the available destination buffer length. Reported-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Signed-off-by: Gary R Hook <gary.h...@amd.co

[PATCH] crypto/ccp - Fill the result buffer only on digest, finup, and final ops

2018-03-07 Thread Gary R Hook
Any change to the result buffer should only happen on final, finup and digest operations. Changes to the buffer for update, import, export, etc, are not allowed. Fixes: 66d7b9f6175e ("crypto: testmgr - test misuse of result in ahash") Signed-off-by: Gary R Hook <gary.h...@amd.

[PATCH] crypto: doc - Document remaining members in struct crypto_alg

2018-03-14 Thread Gary R Hook
Add missing comments for union members ablkcipher, blkcipher, cipher, and compress. This silences complaints when building the htmldocs. Fixes: 0d7f488f0305a (crypto: doc - cipher data structures) Signed-off-by: Gary R Hook <gary.h...@amd.com> --- include/linux/crypto.h |8

Re: Why are we testing an intermediate result in ahash?

2018-03-05 Thread Gary R Hook
On 03/05/2018 03:50 AM, Herbert Xu wrote: On Fri, Mar 02, 2018 at 03:11:52PM -0600, Gary R Hook wrote: Commit 466d7b9f6 (cryptodev-2.6) added code to testmgr to populate, for async hash operations, the result buffer with a known value and to test the buffer against that value at intermediate

Re: Why are we testing an intermediate result in ahash?

2018-03-05 Thread Gary R Hook
On 03/05/2018 03:57 AM, Kamil Konieczny wrote: On 02.03.2018 22:11, Gary R Hook wrote: Commit 466d7b9f6 (cryptodev-2.6) added code to testmgr to populate, for async hash operations, the result buffer with a known value and to test the buffer against that value at intermediate steps

Re: [PATCH] crypto: ccp: Use memdup_user() rather than duplicating its implementation

2018-03-05 Thread Gary R Hook
Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net> Acked-by: Gary R Hook <gary.h...@amd.com> --- drivers/crypto/ccp/psp-dev.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c

Re: Why are we testing an intermediate result in ahash?

2018-03-05 Thread Gary R Hook
On 03/05/2018 12:31 PM, Kamil Konieczny wrote: On 05.03.2018 18:47, Gary R Hook wrote: On 03/05/2018 03:57 AM, Kamil Konieczny wrote: On 02.03.2018 22:11, Gary R Hook wrote: Commit 466d7b9f6 (cryptodev-2.6) added code to testmgr to populate, for async hash operations, the result buffer

Why are we testing an intermediate result in ahash?

2018-03-02 Thread Gary R Hook
Commit 466d7b9f6 (cryptodev-2.6) added code to testmgr to populate, for async hash operations, the result buffer with a known value and to test the buffer against that value at intermediate steps. If the result buffer changes the operation is failed. My question is: why? What problem does

Re: [PATCH 2/3] crypto: ccp - return an actual key size from RSA max_size callback

2018-03-02 Thread Gary R Hook
On 03/02/2018 05:58 PM, Maciej S. Szmigiero wrote: On 03.03.2018 00:49, Hook, Gary wrote: On 3/2/2018 5:15 PM, Maciej S. Szmigiero wrote: Thanks. However, what about the first patch from this series? Without it, while it no longer should cause a buffer overflow, in-kernel X.509 certificate

Re: [PATCH -next] crypto: ccp - Make function sev_get_firmware() static

2018-09-25 Thread Gary R Hook
On 09/25/2018 09:35 AM, Wei Yongjun wrote: > Fixes the following sparse warning: > > drivers/crypto/ccp/psp-dev.c:444:5: warning: > symbol 'sev_get_firmware' was not declared. Should it be static? > > Signed-off-by: Wei Yongjun This appears to have been introduced by (cryptodev-2.6) commit

<    1   2   3