Re: [Outreachy kernel] [PATCH v4] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Julia Lawall
One last detail. The subject line above is not in the same format as that of all of the other subject lines one commits affecting this file. You can use git log --oneline to see what others have done. It is not really possible to guess correctly. However, one does not generally include the exte

Re: [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Joe Perches
On Thu, 2017-09-07 at 00:32 +0300, Dan Carpenter wrote: > Always compile your patches. > > CC [M] drivers/staging/ccree/ssi_cipher.o > drivers/staging/ccree/ssi_cipher.c: In function ‘ssi_blkcipher_complete’: > drivers/staging/ccree/ssi_cipher.c:700:6: warning: unused variable > ‘inflight_coun

Re: [PATCH] crypto: authenc - cryptlen must be at least AAD len

2017-09-06 Thread Herbert Xu
On Thu, Sep 07, 2017 at 08:04:25AM +0200, Stephan Mueller wrote: > > I sill send a new patch -- shall I first send it excluding stable so that we > can review it before bothering the stable folks? You don't need to cc the email to sta...@vger.kernel.org, just add a Cc: tag in the patch descriptio

Re: [PATCH] crypto: authenc - cryptlen must be at least AAD len

2017-09-06 Thread Stephan Mueller
Am Donnerstag, 7. September 2017, 08:01:08 CEST schrieb Herbert Xu: Hi Herbert, > On Thu, Sep 07, 2017 at 07:48:53AM +0200, Stephan Müller wrote: > > There is already such check: > > > > static inline int crypto_aead_decrypt(struct aead_request *req) > > { > > > > struct crypto_aead *ae

Re: [PATCH] crypto: authenc - cryptlen must be at least AAD len

2017-09-06 Thread Herbert Xu
On Thu, Sep 07, 2017 at 07:48:53AM +0200, Stephan Müller wrote: > > There is already such check: > > static inline int crypto_aead_decrypt(struct aead_request *req) > { > struct crypto_aead *aead = crypto_aead_reqtfm(req); > > if (req->cryptlen < crypto_aead_authsize(aead)) >

Re: [PATCH] crypto: authenc - cryptlen must be at least AAD len

2017-09-06 Thread Stephan Müller
Am Donnerstag, 7. September 2017, 05:54:05 CEST schrieb Herbert Xu: Hi Herbert, > > > > What is your opinion: should this check be rather added to > > crypto_aead_encrypt (similar to a sanity check found in > > crypto_aead_decrypt)? > > Doesn't this apply to decryption as well? There is already

Re: [PATCH] crypto: authenc - cryptlen must be at least AAD len

2017-09-06 Thread Herbert Xu
On Wed, Sep 06, 2017 at 10:10:08PM +0200, Stephan Müller wrote: > Am Mittwoch, 6. September 2017, 21:22:44 CEST schrieb Stephan Müller: > > Hi Herbert, > > > With AF_ALG, AAD len and cryptlen can be set freely by unprivileged > > user space. The cipher implementation must therefore validate the i

[PATCH] crc32-pclmul: remove useless relative addressing

2017-09-06 Thread Mikulas Patocka
In 32-bit mode, the x86 architecture can hold full 32-bit pointers. Therefore, the code that copies the current address to the %ecx register and uses %ecx-relative addressing is useless, we could just use absolute addressing. The processors have a stack of return addresses for branch prediction. I

Re: [PATCH 00/12] x86/crypto: Fix RBP usage in several crypto .S files

2017-09-06 Thread Josh Poimboeuf
On Fri, Sep 01, 2017 at 05:09:19PM -0700, Eric Biggers wrote: > Hi Josh, > > On Tue, Aug 29, 2017 at 01:05:33PM -0500, Josh Poimboeuf wrote: > > Many of the x86 crypto functions use RBP as a temporary register. This > > breaks frame pointer convention, and breaks stack traces when unwinding > > f

[PATCH v4] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Srishti Sharma
Remove local variable inflight_counter, as it is never used. Signed-off-by: Srishti Sharma --- Change in v4: -There is no longer a need to make the comment more comprehensible, as I have deleted the variable associated with it. The v3 of this patch was not based on the original patch, hence

Re: [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Srishti Sharma
On Thu, Sep 7, 2017 at 3:02 AM, Dan Carpenter wrote: > Always compile your patches. > > CC [M] drivers/staging/ccree/ssi_cipher.o > drivers/staging/ccree/ssi_cipher.c: In function ‘ssi_blkcipher_complete’: > drivers/staging/ccree/ssi_cipher.c:700:6: warning: unused variable > ‘inflight_counter

Re: [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Dan Carpenter
Always compile your patches. CC [M] drivers/staging/ccree/ssi_cipher.o drivers/staging/ccree/ssi_cipher.c: In function ‘ssi_blkcipher_complete’: drivers/staging/ccree/ssi_cipher.c:700:6: warning: unused variable ‘inflight_counter’ [-Wunused-variable] u32 inflight_counter; ^

Re: [Outreachy kernel] [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Srishti Sharma
On Thu, Sep 7, 2017 at 2:56 AM, Julia Lawall wrote: > > > On Thu, 7 Sep 2017, Srishti Sharma wrote: > >> On Thu, Sep 7, 2017 at 2:47 AM, Julia Lawall wrote: >> > >> > >> > On Thu, 7 Sep 2017, Srishti Sharma wrote: >> > >> >> Remove local variable inflight_counter ,as it is never used. >> > >> > "

Re: [RFC Part2 PATCH v3 02/26] crypto: ccp: Add Platform Security Processor (PSP) device support

2017-09-06 Thread Gary R Hook
On 09/06/2017 03:46 PM, Borislav Petkov wrote: On Wed, Sep 06, 2017 at 03:38:38PM -0500, Brijesh Singh wrote: This bit of my struggle -- tip/master is not in sync with cryptodev-2.6 [1]. Aaha. In order to expand the CCP driver we need the following commits from the cryptodev-2.6 57de3aefb73

Re: [Outreachy kernel] [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Julia Lawall
On Thu, 7 Sep 2017, Srishti Sharma wrote: > On Thu, Sep 7, 2017 at 2:47 AM, Julia Lawall wrote: > > > > > > On Thu, 7 Sep 2017, Srishti Sharma wrote: > > > >> Remove local variable inflight_counter ,as it is never used. > > > > "counter ,as" -> "counter, as" > > > >> Signed-off-by: Srishti Shar

Re: [Outreachy kernel] [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Srishti Sharma
On Thu, Sep 7, 2017 at 2:47 AM, Julia Lawall wrote: > > > On Thu, 7 Sep 2017, Srishti Sharma wrote: > >> Remove local variable inflight_counter ,as it is never used. > > "counter ,as" -> "counter, as" > >> Signed-off-by: Srishti Sharma >> --- >> Changes in v3: >> - There was no longer a need to

Re: [Outreachy kernel] [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Julia Lawall
On Thu, 7 Sep 2017, Srishti Sharma wrote: > Remove local variable inflight_counter ,as it is never used. "counter ,as" -> "counter, as" > Signed-off-by: Srishti Sharma > --- > Changes in v3: > - There was no longer a need to make the comment more comprehensible as >I have deleted the var

[PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Srishti Sharma
Remove local variable inflight_counter ,as it is never used. Signed-off-by: Srishti Sharma --- Changes in v3: - There was no longer a need to make the comment more comprehensible as I have deleted the variable associated with it because it is unused . drivers/staging/ccree/ssi_cipher.c | 5 +

Re: [PATCH] Staging: ccree: ssi_cipher.c: Correct spelling mistake.

2017-09-06 Thread Srishti Sharma
On Thu, Sep 7, 2017 at 2:29 AM, Dan Carpenter wrote: > On Thu, Sep 07, 2017 at 12:54:23AM +0530, Srishti Sharma wrote: >> Correct spelling of counter in comment . >> >> Signed-off-by: Srishti Sharma >> --- >> drivers/staging/ccree/ssi_cipher.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletio

Re: [Outreachy kernel] [PATCH v2] Staging: ccree: ssi_cipher.c: Make comment more comprehensible.

2017-09-06 Thread Srishti Sharma
On Thu, Sep 7, 2017 at 2:28 AM, Julia Lawall wrote: > > > On Thu, 7 Sep 2017, Srishti Sharma wrote: > >> Edited comment to make it more comprehensible. >> >> Signed-off-by: Srishti Sharma >> --- >> Changes in v2: >> - Make comment more comprehensible , instead of just correcting typos. >> drive

Re: [PATCH] Staging: ccree: ssi_cipher.c: Correct spelling mistake.

2017-09-06 Thread Dan Carpenter
On Thu, Sep 07, 2017 at 12:54:23AM +0530, Srishti Sharma wrote: > Correct spelling of counter in comment . > > Signed-off-by: Srishti Sharma > --- > drivers/staging/ccree/ssi_cipher.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/ccree/ssi_cipher.c >

Re: [Outreachy kernel] [PATCH v2] Staging: ccree: ssi_cipher.c: Make comment more comprehensible.

2017-09-06 Thread Julia Lawall
On Thu, 7 Sep 2017, Srishti Sharma wrote: > Edited comment to make it more comprehensible. > > Signed-off-by: Srishti Sharma > --- > Changes in v2: > - Make comment more comprehensible , instead of just correcting typos. > drivers/staging/ccree/ssi_cipher.c | 4 +++- > 1 file changed, 3 inser

[PATCH v2] Staging: ccree: ssi_cipher.c: Make comment more comprehensible.

2017-09-06 Thread Srishti Sharma
Edited comment to make it more comprehensible. Signed-off-by: Srishti Sharma --- Changes in v2: - Make comment more comprehensible , instead of just correcting typos. drivers/staging/ccree/ssi_cipher.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/ccree/

Re: [RFC Part2 PATCH v3 02/26] crypto: ccp: Add Platform Security Processor (PSP) device support

2017-09-06 Thread Borislav Petkov
On Wed, Sep 06, 2017 at 03:38:38PM -0500, Brijesh Singh wrote: > This bit of my struggle -- tip/master is not in sync with cryptodev-2.6 [1]. Aaha. > In order to expand the CCP driver we need the following commits from the > cryptodev-2.6 > > 57de3aefb73f crypto: ccp - remove ccp_present() check

Re: [Outreachy kernel] Re: [PATCH] Staging: ccree: ssi_cipher.c: Correct spelling mistake.

2017-09-06 Thread Julia Lawall
On Wed, 6 Sep 2017, Srishti Sharma wrote: > > > On Thursday, September 7, 2017 at 12:54:49 AM UTC+5:30, Srishti Sharma > wrote: > Correct spelling of counter in comment . > > Signed-off-by: Srishti Sharma > --- >  drivers/staging/ccree/ssi_cipher.c | 2 +- >  1 file

Re: [RFC Part2 PATCH v3 02/26] crypto: ccp: Add Platform Security Processor (PSP) device support

2017-09-06 Thread Brijesh Singh
Hi Boris, On 09/06/2017 12:00 PM, Borislav Petkov wrote: ... -- |diff --git a/drivers/crypto/ccp/sp-dev.c b/drivers/crypto/ccp/sp-dev.c |index a017233..d263ba4 100644 |--- a/drivers/crypto/ccp/sp-dev.c |+++ b/drivers/crypto/ccp/sp-dev.c -- What

Re: [PATCH] crypto: authenc - cryptlen must be at least AAD len

2017-09-06 Thread Stephan Müller
Am Mittwoch, 6. September 2017, 21:22:44 CEST schrieb Stephan Müller: Hi Herbert, > With AF_ALG, AAD len and cryptlen can be set freely by unprivileged > user space. The cipher implementation must therefore validate the input > data for sanity. For AEAD ciphers, this implies that cryptlen must be

Re: [PATCH 8/8] staging: ccree: remove BUG macro usage

2017-09-06 Thread Dan Carpenter
On Sun, Sep 03, 2017 at 11:56:50AM +0300, Gilad Ben-Yossef wrote: > @@ -1154,7 +1150,8 @@ static inline int ssi_buffer_mgr_aead_chain_data( > //if have reached the end of the sgl, then this is unexpected > if (!areq_ctx->src_sgl) { > SSI_LOG_ERR("re

[PATCH] Staging: ccree: ssi_cipher.c: Correct spelling mistake.

2017-09-06 Thread Srishti Sharma
Correct spelling of counter in comment . Signed-off-by: Srishti Sharma --- drivers/staging/ccree/ssi_cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_cipher.c b/drivers/staging/ccree/ssi_cipher.c index 8d31a93..99232b2 100644 --- a/drivers/s

[PATCH] crypto: authenc - cryptlen must be at least AAD len

2017-09-06 Thread Stephan Müller
With AF_ALG, AAD len and cryptlen can be set freely by unprivileged user space. The cipher implementation must therefore validate the input data for sanity. For AEAD ciphers, this implies that cryptlen must be at least as large as AAD size. This fixes a kernel crash that can be triggered via AF_AL

Re: [RFC Part2 PATCH v3 02/26] crypto: ccp: Add Platform Security Processor (PSP) device support

2017-09-06 Thread Borislav Petkov
On Mon, Jul 24, 2017 at 03:02:39PM -0500, Brijesh Singh wrote: > Platform Security Processor (PSP) is part of AMD Secure Processor (AMD-SP), > PSP is a dedicated processor that provides the support for key management > commands in a Secure Encrypted Virtualiztion (SEV) mode, along with > software-b

Re: [PATCH 06/12] x86/crypto: Fix RBP usage in sha1_avx2_x86_64_asm.S

2017-09-06 Thread Tim Chen
On 08/29/2017 11:05 AM, Josh Poimboeuf wrote: > Using RBP as a temporary register breaks frame pointer convention and > breaks stack traces when unwinding from an interrupt in the crypto code. > > Use R11 instead of RBP. Since R11 isn't a callee-saved register, it > doesn't need to be saved and r

[RFC] tpm: Register RNG device only on tpm chip init

2017-09-06 Thread PrasannaKumar Muralidharan
RNG device is registered as soon as tpm-rng module is loaded even if there are no TPM chip available. Call hwrng_register once tpm chip has registered. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/tpm-rng.c | 50 drivers/char/tpm/t

[PATCH] crypto: axis - hide an unused variable

2017-09-06 Thread Arnd Bergmann
Without CONFIG_DEBUG_FS, we get a harmless warning: drivers/crypto/axis/artpec6_crypto.c:352:23: error: 'dbgfs_root' defined but not used [-Werror=unused-variable] This moves it into the #ifdef that hides the only user. Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driv

Re: [PATCH] crypto: caam - properly set IV after {en,de}crypt

2017-09-06 Thread Gilad Ben-Yossef
On Tue, Sep 5, 2017 at 6:33 PM, Horia Geantă wrote: > On 8/14/2017 10:59 AM, Gilad Ben-Yossef wrote: >> Hi, >> >> On Thu, Jun 29, 2017 at 1:19 PM, Horia Geantă wrote: >>> On 6/28/2017 4:42 PM, Horia Geantă wrote: On 6/28/2017 4:27 PM, David Gstir wrote: > Certain cipher modes like CTS ex