[PATCH] staging: ccree: Fix indentation in ssi_buffer_mgr.c

2017-10-26 Thread Stephen Brennan
In particular, fixes some over-indented if statement bodies as well as a couple lines indented with spaces. checkpatch.pl now reports no warnings on this file other than 80 character warnings. Signed-off-by: Stephen Brennan --- Hello again, hoping these indentation issues are a bit more actionabl

Re: [PATCH] staging: ccree: Fix lines longer than 80 characters

2017-10-26 Thread Stephen Brennan
Apologies for the noise, this was the wrong patch. Please ignore this.

[PATCH] staging: ccree: Fix lines longer than 80 characters

2017-10-26 Thread Stephen Brennan
Simply break down some long lines and tab-indent them. Signed-off-by: Stephen Brennan --- I'm learning the patch submission process, and this is my first patch. I know it's trivial but I'm just trying to get my feet wet. Thanks in advance for taking the time to review this! drivers/staging/ccre

Re: [PATCH v5 12/18] MODSIGN: Export module signature definitions

2017-10-26 Thread Mimi Zohar
On Thu, 2017-10-26 at 20:47 -0200, Thiago Jung Bauermann wrote: > Mimi Zohar writes: > > > On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > >> IMA will use the module_signature format for append signatures, so export > >> the relevant definitions and factor out the code which ver

Re: [PATCH v5 12/18] MODSIGN: Export module signature definitions

2017-10-26 Thread Thiago Jung Bauermann
Mimi Zohar writes: > On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: >> IMA will use the module_signature format for append signatures, so export >> the relevant definitions and factor out the code which verifies that the >> appended signature trailer is valid. >> >> Also, creat

Re: [PATCH v5 18/18] ima: Write modsig to the measurement list

2017-10-26 Thread Thiago Jung Bauermann
Hello Mimi, Thanks for your review. Mimi Zohar writes: > On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > >> diff --git a/security/integrity/ima/ima_main.c >> b/security/integrity/ima/ima_main.c >> index 6a2d960fbd92..0d3390de7432 100644 >> --- a/security/integrity/ima/ima_ma

Re: [Part2 PATCH v6 13/38] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-26 Thread Brijesh Singh
On 10/26/2017 03:13 PM, Borislav Petkov wrote: On Thu, Oct 26, 2017 at 02:26:15PM -0500, Brijesh Singh wrote: SHUTDOWN command unconditionally transitions a platform to uninitialized state. The command does not care how many processes are actively using the PSP. We don't want to shutdown the f

Re: [PATCH v5 00/18] Appended signatures support for IMA appraisal

2017-10-26 Thread Mimi Zohar
On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > Hello, > > The main highlight in this version is that it fixes a bug where the modsig > wasn't being included in the measurement list if the appraised file was > already measured by another rule. The fix is in the last patch. > > A

Re: [Part2 PATCH v6 13/38] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-26 Thread Borislav Petkov
On Thu, Oct 26, 2017 at 02:26:15PM -0500, Brijesh Singh wrote: > SHUTDOWN command unconditionally transitions a platform to uninitialized > state. The command does not care how many processes are actively using the > PSP. We don't want to shutdown the firmware while other process is still > using i

Re: [PATCH v5 13/18] PKCS#7: Introduce pkcs7_get_message_sig and verify_pkcs7_message_sig

2017-10-26 Thread Mimi Zohar
On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > IMA will need to access the digest used in the signature so that it can > verify files containing module-style appended signatures. For this purpose, > add function pkcs7_get_message_sig. > > It will also need to verify an already p

Re: [PATCH v5 12/18] MODSIGN: Export module signature definitions

2017-10-26 Thread Mimi Zohar
On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > IMA will use the module_signature format for append signatures, so export > the relevant definitions and factor out the code which verifies that the > appended signature trailer is valid. > > Also, create a CONFIG_MODULE_SIG_FORMAT

Re: [PATCH v5 18/18] ima: Write modsig to the measurement list

2017-10-26 Thread Mimi Zohar
On Tue, 2017-10-17 at 22:53 -0200, Thiago Jung Bauermann wrote: > diff --git a/security/integrity/ima/ima_main.c > b/security/integrity/ima/ima_main.c > index 6a2d960fbd92..0d3390de7432 100644 > --- a/security/integrity/ima/ima_main.c > +++ b/security/integrity/ima/ima_main.c > @@ -246,7 +246,35

Re: [Part2 PATCH v6 13/38] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-26 Thread Brijesh Singh
On 10/26/2017 12:44 PM, Borislav Petkov wrote: On Thu, Oct 26, 2017 at 11:56:57AM -0500, Brijesh Singh wrote: The variable is used as ref counter. ... and it can't be converted to a boolean because...? SHUTDOWN command unconditionally transitions a platform to uninitialized state. The co

Re: [Part2 PATCH v6 13/38] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-26 Thread Borislav Petkov
On Thu, Oct 26, 2017 at 11:56:57AM -0500, Brijesh Singh wrote: > The variable is used as ref counter. ... and it can't be converted to a boolean because...? > In your previous reply you comments on global semaphore (fw_init_mutex) and > in response I tried to highlight why we need the global sema

Re: [PATCH 0/4] Rearrange functions to remove forward declarations

2017-10-26 Thread PrasannaKumar Muralidharan
Hi David, On 26 October 2017 at 22:18, David Daney wrote: > On 10/26/2017 08:34 AM, PrasannaKumar Muralidharan wrote: >> >> This patch series rearranges functions such that forward declarations >> becomes unnecessary. Remove those forward declaration. > > > Why? > > The code churn and increase in

Re: [Part2 PATCH v6 13/38] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-26 Thread Brijesh Singh
On 10/26/2017 08:56 AM, Borislav Petkov wrote: On Mon, Oct 23, 2017 at 02:57:04PM -0500, Brijesh Singh wrote: Calling PLATFORM_GET_STATUS is not required, we can manage the state through a simple ref count variable. Issuing PSP commands will always be much more expensive compare to accessing a

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread Jason Gunthorpe
On Thu, Oct 26, 2017 at 09:57:12PM +0530, PrasannaKumar Muralidharan wrote: > I do not what value my rb tag provides as I have not contributed code > to it before. Is it encouraged by kernel community? Yes. People will judge the quality of your rb tag based on other reviews they have seen you mak

Re: [PATCH 0/4] Rearrange functions to remove forward declarations

2017-10-26 Thread David Daney
On 10/26/2017 08:34 AM, PrasannaKumar Muralidharan wrote: This patch series rearranges functions such that forward declarations becomes unnecessary. Remove those forward declaration. Why? The code churn and increase in difficulty of attribution are big drawbacks to this sort of patch set.

[PATCH] hw_random: core: Remove unnecessary new line in MODULE_PARM_DESC

2017-10-26 Thread PrasannaKumar Muralidharan
While using MODULE_PARM_DESC there is a new line which is not required. Remove it. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread PrasannaKumar Muralidharan
On 26 October 2017 at 21:39, Jarkko Sakkinen wrote: > On Thu, Oct 26, 2017 at 07:40:49PM +0530, PrasannaKumar Muralidharan wrote: >> Hi Jarkko, >> >> On 26 October 2017 at 19:24, Jarkko Sakkinen >> wrote: >> > Device number (the character device index) is not a stable identifier >> > for a TPM ch

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-26 Thread PrasannaKumar Muralidharan
On 26 October 2017 at 00:41, Jarkko Sakkinen wrote: > On Wed, Oct 25, 2017 at 08:21:16PM +0530, PrasannaKumar Muralidharan wrote: >> >> > 2. Moving struct tpm_rng to the TPM client is architecturally >> >> >uacceptable. >> >> >> >> As there was no response to the patch there is no way to know

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread Jarkko Sakkinen
On Thu, Oct 26, 2017 at 07:40:49PM +0530, PrasannaKumar Muralidharan wrote: > Hi Jarkko, > > On 26 October 2017 at 19:24, Jarkko Sakkinen > wrote: > > Device number (the character device index) is not a stable identifier > > for a TPM chip. That is the reason why every call site passes > > TPM_AN

[PATCH 4/4] hw_random: core: Remove forward declaration of hwrng_init

2017-10-26 Thread PrasannaKumar Muralidharan
Rearrange set_current_rng such that hwrng_init's forward declaration can be removed. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/char/hw_random/core.c

[PATCH 2/4] hw_random: core: Rearranging rng_get_data to remove forward declaration

2017-10-26 Thread PrasannaKumar Muralidharan
Rearrange rng_get_data such that its forward declaration is not required. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 41 +++-- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/char/hw_random/core.c b/dr

[PATCH 1/4] hw_random: core: Remove forward declaration by rearranging code

2017-10-26 Thread PrasannaKumar Muralidharan
Rearrange drop_current_rng such that its forward declaration is not required. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_

[PATCH 3/4] hw_random: core: Rearranging start_khwrngd to remove forward declaration

2017-10-26 Thread PrasannaKumar Muralidharan
Rearrange start_khwrngd such that its forward declaration is not required. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 75 +-- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/drivers/char/hw_random/core.c b

[PATCH 0/4] Rearrange functions to remove forward declarations

2017-10-26 Thread PrasannaKumar Muralidharan
This patch series rearranges functions such that forward declarations becomes unnecessary. Remove those forward declaration. This patch series is boot tested without user space in qemu with CONFIG_HW_RANDOM=y. PrasannaKumar Muralidharan (4): hw_random: core: Remove forward declaration by rearra

Re: [PATCH] drivers/crypto: Convert timers to use timer_setup()

2017-10-26 Thread Lars Persson
On 10/25/2017 12:18 PM, Kees Cook wrote: In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Herbert Xu Cc: Jesper Nilsson Cc: Lars Persson Cc: Nikla

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

2017-10-26 Thread Borislav Petkov
On Mon, Oct 23, 2017 at 04:55:19PM -0500, Brijesh Singh wrote: > The SEV_PEK_GEN command is used to generate a new Platform Endorsement > Key (PEK). The command is defined in SEV spec section 5.6. > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Borislav Petkov > Cc: Herbert Xu > Cc: Gary Hook

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread PrasannaKumar Muralidharan
Hi Jarkko, On 26 October 2017 at 19:24, Jarkko Sakkinen wrote: > Device number (the character device index) is not a stable identifier > for a TPM chip. That is the reason why every call site passes > TPM_ANY_NUM to tpm_chip_find_get(). > > This commit changes the API in a way that instead a stru

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread Jarkko Sakkinen
On Thu, Oct 26, 2017 at 03:54:50PM +0200, Jarkko Sakkinen wrote: > Device number (the character device index) is not a stable identifier > for a TPM chip. That is the reason why every call site passes > TPM_ANY_NUM to tpm_chip_find_get(). > > This commit changes the API in a way that instead a str

Re: [Part2 PATCH v6 13/38] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-26 Thread Borislav Petkov
On Mon, Oct 23, 2017 at 02:57:04PM -0500, Brijesh Singh wrote: > Calling PLATFORM_GET_STATUS is not required, we can manage the state through > a simple ref count variable. Issuing PSP commands will always be much more > expensive compare to accessing a protected global variable. What does "protec

[PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread Jarkko Sakkinen
Device number (the character device index) is not a stable identifier for a TPM chip. That is the reason why every call site passes TPM_ANY_NUM to tpm_chip_find_get(). This commit changes the API in a way that instead a struct tpm_chip instance is given and NULL means the default chip. In addition

Re: [PATCH] drivers/crypto: Convert timers to use timer_setup()

2017-10-26 Thread Jamie Iles
On Wed, Oct 25, 2017 at 03:18:42AM -0700, Kees Cook wrote: > In preparation for unconditionally passing the struct timer_list pointer to > all timer callbacks, switch to using the new timer_setup() and from_timer() > to pass the timer pointer explicitly. > > Cc: Herbert Xu > Cc: Jesper Nilsson >

[PATCH] hw_random: Include device.h instead of declaring struct device

2017-10-26 Thread PrasannaKumar Muralidharan
Include linux/device.h instead of declaring struct device. Signed-off-by: PrasannaKumar Muralidharan --- include/linux/hw_random.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index bee0827..2ec9af7 100644 --- a/inclu

[v2 PATCH 2/3] crypto: atmel-aes/tdes - remove empty functions

2017-10-26 Thread Tudor Ambarus
This empty functions were used to initialize a member of a static structure. Pointer members of an object with static storage duration, if not explicitly initialized, will be initialized to a NULL pointer. The crypto API checks if this pointer is not NULL before using it, so we are safe to remove t

Re: Kernel panic when using ccm(aes) with the Atmel AES HW accelerator

2017-10-26 Thread Tudor Ambarus
Hi, Romain, On 10/18/2017 04:32 PM, Romain Izard wrote: diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 29e20c37f3a6..f3eabe1f1490 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -80,6 +80,7 @@ #define AES_FLAGS_BUSY BIT(3) #defi

Re: [PATCH v2] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread Jarkko Sakkinen
On Wed, Oct 25, 2017 at 02:17:44PM -0600, Jason Gunthorpe wrote: > On Wed, Oct 25, 2017 at 10:07:46PM +0200, Jarkko Sakkinen wrote: > > > The id has a nice feature that it is unique for one boot cycle you can > > even try to get a chip that has been deleted. It has the most stable > > properties i