[PATCH] crypto: qat - fix error path in adf_isr_resource_alloc()

2021-03-25 Thread Giovanni Cabiddu
The function adf_isr_resource_alloc() is not unwinding correctly in case of error. This patch fixes the error paths and propagate the errors to the caller. Fixes: 7afa232e76ce ("crypto: qat - Intel(R) QAT DH895xcc accelerator") Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero --- dr

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

2021-03-25 Thread Mickaël Salaün
Hi David, What is the status of this patchset? Could you please push it to -next? Regards, Mickaël On 12/03/2021 18:12, Mickaël Salaün wrote: > 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 th

Re: [RFC Part2 PATCH 07/30] mm: add support to split the large THP based on RMP violation

2021-03-25 Thread Dave Hansen
On 3/24/21 10:04 AM, Brijesh Singh wrote: > @@ -1377,6 +1442,22 @@ void do_user_addr_fault(struct pt_regs *regs, > if (hw_error_code & X86_PF_INSTR) > flags |= FAULT_FLAG_INSTRUCTION; > > + /* > + * If its an RMP violation, see if we can resolve it. > + */ > +

Re: [RFC Part2 PATCH 05/30] x86: define RMP violation #PF error code

2021-03-25 Thread Brijesh Singh
On 3/24/21 1:03 PM, Dave Hansen wrote: >> diff --git a/arch/x86/include/asm/trap_pf.h b/arch/x86/include/asm/trap_pf.h >> index 10b1de500ab1..107f9d947e8d 100644 >> --- a/arch/x86/include/asm/trap_pf.h >> +++ b/arch/x86/include/asm/trap_pf.h >> @@ -12,6 +12,7 @@ >> * bit 4 ==

Re: [RFC Part2 PATCH 05/30] x86: define RMP violation #PF error code

2021-03-25 Thread Dave Hansen
On 3/25/21 7:32 AM, Brijesh Singh wrote: >>> enum x86_pf_error_code { >>> X86_PF_PROT = 1 << 0, >>> @@ -21,6 +22,7 @@ enum x86_pf_error_code { >>> X86_PF_INSTR= 1 << 4, >>> X86_PF_PK = 1 << 5, >>> X86_PF_SGX =

Re: [RFC Part2 PATCH 07/30] mm: add support to split the large THP based on RMP violation

2021-03-25 Thread Dave Hansen
On 3/24/21 10:04 AM, Brijesh Singh wrote: > When SEV-SNP is enabled globally in the system, a write from the hypervisor > can raise an RMP violation. We can resolve the RMP violation by splitting > the virtual address to a lower page level. > > e.g > - guest made a page shared in the RMP entry so

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-25 Thread Dave Hansen
> +static int __init mem_encrypt_snp_init(void) > +{ > + if (!boot_cpu_has(X86_FEATURE_SEV_SNP)) > + return 1; > + > + if (rmptable_init()) { > + setup_clear_cpu_cap(X86_FEATURE_SEV_SNP); > + return 1; > + } > + > + static_branch_enable(&snp_enabl

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-03-25 Thread Dave Hansen
On 3/24/21 10:04 AM, Brijesh Singh wrote: > The spliting of the physmap is a temporary solution until we work to > improve the kernel page fault handler to split the pages on demand. > One of the disadvtange of splitting is that eventually, we will end up > breaking down the entire physmap unless w

Re: [RFC Part2 PATCH 07/30] mm: add support to split the large THP based on RMP violation

2021-03-25 Thread Brijesh Singh
On 3/25/21 9:48 AM, Dave Hansen wrote: > On 3/24/21 10:04 AM, Brijesh Singh wrote: >> When SEV-SNP is enabled globally in the system, a write from the hypervisor >> can raise an RMP violation. We can resolve the RMP violation by splitting >> the virtual address to a lower page level. >> >> e.g >>

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-25 Thread Brijesh Singh
On 3/25/21 9:58 AM, Dave Hansen wrote: >> +static int __init mem_encrypt_snp_init(void) >> +{ >> +if (!boot_cpu_has(X86_FEATURE_SEV_SNP)) >> +return 1; >> + >> +if (rmptable_init()) { >> +setup_clear_cpu_cap(X86_FEATURE_SEV_SNP); >> +return 1; >> +}

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-25 Thread Dave Hansen
On 3/25/21 8:31 AM, Brijesh Singh wrote: > > On 3/25/21 9:58 AM, Dave Hansen wrote: >>> +static int __init mem_encrypt_snp_init(void) >>> +{ >>> + if (!boot_cpu_has(X86_FEATURE_SEV_SNP)) >>> + return 1; >>> + >>> + if (rmptable_init()) { >>> + setup_clear_cpu_cap(X86_FEATUR

Re: [RFC Part2 PATCH 07/30] mm: add support to split the large THP based on RMP violation

2021-03-25 Thread Dave Hansen
On 3/25/21 8:24 AM, Brijesh Singh wrote: > On 3/25/21 9:48 AM, Dave Hansen wrote: >> On 3/24/21 10:04 AM, Brijesh Singh wrote: >>> When SEV-SNP is enabled globally in the system, a write from the hypervisor >>> can raise an RMP violation. We can resolve the RMP violation by splitting >>> the virtua

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-25 Thread Brijesh Singh
On 3/25/21 10:51 AM, Dave Hansen wrote: > On 3/25/21 8:31 AM, Brijesh Singh wrote: >> On 3/25/21 9:58 AM, Dave Hansen wrote: +static int __init mem_encrypt_snp_init(void) +{ + if (!boot_cpu_has(X86_FEATURE_SEV_SNP)) + return 1; + + if (rmptable_init()) { >

[PATCH] crypto: hisilicon/qm - delete redundant code

2021-03-25 Thread Kai Ye
The memory not needed to clear that will be freed. and the memset is useless after the dma is freed. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/qm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index 13cb421..88a6c6f 100

[PATCH 0/3] crypto: replace memset by memzero_explicit

2021-03-25 Thread Kai Ye
use memzero_explicit instead of memset to clear sensitive data, such as buffer or key. Kai Ye (3): crypto: atmel - use memzero_explicit() for clearing data crypto: qce - use memzero_explicit() for clearing data crypto: stm32 - use memzero_explicit() for clearing data drivers/crypto/atmel

[PATCH 1/3] crypto: atmel - use memzero_explicit() for clearing data

2021-03-25 Thread Kai Ye
use memzero_explicit instead of memset to clear sensitive data, such as key. Signed-off-by: Kai Ye --- drivers/crypto/atmel-sha.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 352d80c..4a08b2a 100644 --- a/driver

[PATCH 3/3] crypto: stm32 - use memzero_explicit() for clearing data

2021-03-25 Thread Kai Ye
use memzero_explicit instead of memset to clear sensitive data Signed-off-by: Kai Ye --- drivers/crypto/stm32/stm32-cryp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/stm32/stm32-cryp.c b/drivers/crypto/stm32/stm32-cryp.c index 2a479317..c4297e80 100644 --

[PATCH 2/3] crypto: qce - use memzero_explicit() for clearing data

2021-03-25 Thread Kai Ye
use memzero_explicit instead of memset to clear sensitive data. Signed-off-by: Kai Ye --- drivers/crypto/qce/sha.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c index 61c418c..cb9b3da 100644 --- a/drivers/crypto/qce/sha.c +++ b/drivers/cr

[PATCH] crypto: sm3 - use the more precise type u32 instead of unsigned int

2021-03-25 Thread Tianjia Zhang
In the process of calculating the hash, use the more accurate type 'u32' instead of the original 'unsigned int' to avoid ambiguity. Signed-off-by: Tianjia Zhang --- crypto/sm3_generic.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/sm3_generic.c b/crypto

[PATCH] crypto: async_tx/async_xor.c: Few mundane spello fixes

2021-03-25 Thread Bhaskar Chowdhury
s/eninges/engines/ ...two different places. s/explicity/explicitly/ two different places. Signed-off-by: Bhaskar Chowdhury --- crypto/async_tx/async_xor.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c

Re: [PATCH] crypto: async_tx/async_xor.c: Few mundane spello fixes

2021-03-25 Thread Randy Dunlap
On 3/25/21 7:34 PM, Bhaskar Chowdhury wrote: > > s/eninges/engines/ ...two different places. > s/explicity/explicitly/ two different places. > > Signed-off-by: Bhaskar Chowdhury Acked-by: Randy Dunlap > --- > crypto/async_tx/async_xor.c | 8 > 1 file changed, 4 insertions(+),

Re: [PATCH] crypto: vmx: fix incorrect kernel-doc comment syntax in files

2021-03-25 Thread Daniel Axtens
Hi Aditya, Thanks for your patch! > The opening comment mark '/**' is used for highlighting the beginning of > kernel-doc comments. > There are certain files in drivers/crypto/vmx, which follow this syntax, > but the content inside does not comply with kernel-doc. > Such lines were probably not m

[PATCH] crypto: hisilicon/hpre - rsa key should not be empty

2021-03-25 Thread Meng Yu
We should ensure key is not empty before we set key. Signed-off-by: Meng Yu --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index 53068d2..7cf7d80

[PATCH] pkcs7: Use octal permissions '0444'

2021-03-25 Thread Meng Yu
Fixed following checkpatch warning: Symbolic permissions 'S_IWUSR | S_IRUGO' are not preferred. Consider using octal permissions '0644'. Signed-off-by: Meng Yu --- crypto/asymmetric_keys/pkcs7_key_type.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/asymmetric_keys/p