RE: [PATCH v0] crypto: virtio - Refacotor virtio_crypto driver for new virito crypto services

2017-06-20 Thread Zeng, Xin
Ping... any comments? Thanks < -Original Message- < From: Zeng, Xin < Sent: Wednesday, June 7, 2017 2:18 PM < To: linux-ker...@vger.kernel.org; linux-crypto-ow...@vger.kernel.org; < virtio-...@lists.oasis-open.org < Cc: arei.gong...@huawei.com; Zeng, Xin < Subject:

Re: [PATCH] random: warn when kernel uses unseeded randomness

2017-06-20 Thread Kees Cook
On Tue, Jun 20, 2017 at 5:03 PM, Jason A. Donenfeld wrote: > This enables an important dmesg notification about when drivers have > used the crng without it being seeded first. Prior, these errors would > occur silently, and so there hasn't been a great way of diagnosing these >

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Jason A. Donenfeld
On Wed, Jun 21, 2017 at 1:38 AM, Theodore Ts'o wrote: > The punch was in response to this statement, which I personally found > fairly infuriating: > >>> I more or less agree with you that we should just turn this on for all >>> users and they'll just have to live with the spam and

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Theodore Ts'o
On Tue, Jun 20, 2017 at 11:49:07AM +0200, Jason A. Donenfeld wrote: > Uh, talk about a totally unnecessary punch... In case my last email > wasn't clear, I fully recognize that `default y` is a tad too extreme, > which is why from one of the earliest revisions in this series, I > moved directly to

[PATCH] random: warn when kernel uses unseeded randomness

2017-06-20 Thread Jason A. Donenfeld
This enables an important dmesg notification about when drivers have used the crng without it being seeded first. Prior, these errors would occur silently, and so there hasn't been a great way of diagnosing these types of bugs for obscure setups. By adding this as a config option, we can leave it

Re: [PATCH v6 1/5] Documentation/bindings: Document the SafeXel cryptographic engine driver

2017-06-20 Thread Antoine Tenart
On Tue, Jun 20, 2017 at 11:37:47AM +0800, Herbert Xu wrote: > On Sun, Jun 11, 2017 at 10:53:53AM +0200, Antoine Tenart wrote: > > On Wed, May 24, 2017 at 04:10:31PM +0200, Antoine Tenart wrote: > > > The Inside Secure Safexcel cryptographic engine is found on some Marvell > > > SoCs (7k/8k).

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Theodore Ts'o
On Mon, Jun 19, 2017 at 10:57:18PM +0200, Jason A. Donenfeld wrote: > > With rc6 already released and rc7 coming up, I'd really appreciate you > stepping in here and either ACKing the above commit, or giving your > two cents about it in case I need to roll something different. I actually had set

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Theodore Ts'o
On Tue, Jun 20, 2017 at 10:53:35AM +0200, Jason A. Donenfeld wrote: > > Suppressing all messages for all configurations cast a wider net than > > necessary. Configurations that could potentially be detected and fixed > > likely will go unnoticed. If the problem is not brought to light, then > > it

Re: [PATCH] crypto: sun4i-ss: support the Security System PRNG

2017-06-20 Thread Maxime Ripard
Hi, On Tue, Jun 20, 2017 at 10:58:19AM +0200, Corentin Labbe wrote: > The Security System have a PRNG, this patch add support for it via > crypto_rng. This might be a dumb question, but is the CRYPTO_RNG code really supposed to be used with PRNG? > Signed-off-by: Corentin Labbe

[PATCH v3 3/7] crypto: x86/aes-ni - switch to generic fallback

2017-06-20 Thread Ard Biesheuvel
The time invariant AES-NI implementation is SIMD based, and so it needs a fallback in case the code is called from a context where SIMD is not allowed. On x86, this is really only when executing in the context of an interrupt taken while in kernel mode, since SIMD is allowed in all other cases.

[PATCH] crypto: cavium: make several functions static

2017-06-20 Thread Colin King
From: Colin Ian King The functions cvm_encrypt, cvm_decrypt, cvm_xts_setkey and cvm_enc_dec_init does not need to be in global scope, so make them static. Signed-off-by: Colin Ian King --- drivers/crypto/cavium/cpt/cptvf_algs.c | 8

[PATCH v3 0/7] crypto: aes - allow generic AES to be omitted

2017-06-20 Thread Ard Biesheuvel
The generic AES driver uses 16 lookup tables of 1 KB each, and has encryption and decryption routines that are fully unrolled. Given how the dependencies between this code and other drivers are declared in Kconfig files, this code is always pulled into the core kernel, even if it is usually

[PATCH v3 1/7] drivers/crypto/Kconfig: drop bogus CRYPTO_AES dependencies

2017-06-20 Thread Ard Biesheuvel
In preparation of fine tuning the dependency relations between the accelerated AES drivers and the core support code, let's remove the dependency declarations that are false. None of these modules have link time dependencies on the generic AES code, nor do they declare any AES algos with

[PATCH v3 2/7] crypto: aes - refactor shared routines into separate core module

2017-06-20 Thread Ard Biesheuvel
In preparation of further refactoring and cleanup of the AES code, move the implementations of crypto_aes_expand_key() and crypto_aes_set_key() into a separate module called aes_core, along with the forward Sbox and some GF(2^8) routines that these routines rely on. Also, introduce

Re: [PATCH] crypto: sun4i-ss: support the Security System PRNG

2017-06-20 Thread Corentin Labbe
On Tue, Jun 20, 2017 at 11:59:47AM +0200, Maxime Ripard wrote: > Hi, > > On Tue, Jun 20, 2017 at 10:58:19AM +0200, Corentin Labbe wrote: > > The Security System have a PRNG, this patch add support for it via > > crypto_rng. > > This might be a dumb question, but is the CRYPTO_RNG code really >

[PATCH v3 5/7] crypto: aes - repurpose CRYPTO_AES and introduce CRYPTO_AES_GENERIC

2017-06-20 Thread Ard Biesheuvel
Repurpose the Kconfig symbol CRYPTO_AES to signify that a 'select' or 'depends on' relationship on it can be satisfied by any driver that exposes a generic "aes" cipher. The existing generic AES code is now controlled by a new Kconfig symbol CRYPTO_AES_GENERIC, and only dependencies on CRYPTO_AES

[PATCH v3 4/7] crypto: arm64/aes-neon - reuse Sboxes from AES core module

2017-06-20 Thread Ard Biesheuvel
The newly introduced AES core module exposes its Sboxes for the benefit of the fixed time AES driver. Since the arm64 NEON based implementation already depends on the same core module for its key expansion routines, let's use its Sboxes as well, and remove the local copy. Signed-off-by: Ard

[PATCH v3 6/7] crypto: aes - add meaningful help text to the various AES drivers

2017-06-20 Thread Ard Biesheuvel
Remove the duplicated boilerplate help text and add a bit of explanation about the nature of the various AES implementations that exist for various architectures. In particular, highlight the time variant nature of some implementations, and the fact that they can be omitted if required.

[PATCH v3 7/7] crypto: aes - allow generic AES to be replaced by fixed time AES

2017-06-20 Thread Ard Biesheuvel
On systems where a small memory footprint is important, the generic AES code with its 16 KB of lookup tables and fully unrolled encrypt and decrypt routines may be an unnecessary burden, especially given that modern SoCs often have dedicated instructions for AES. And even if they don't, a time

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Jeffrey Walton
On Tue, Jun 20, 2017 at 5:36 AM, Theodore Ts'o wrote: > On Tue, Jun 20, 2017 at 10:53:35AM +0200, Jason A. Donenfeld wrote: >> > Suppressing all messages for all configurations cast a wider net than >> > necessary. Configurations that could potentially be detected and fixed >> >

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Jason A. Donenfeld
On Tue, Jun 20, 2017 at 11:36 AM, Theodore Ts'o wrote: >> But I think there's another camp that would mutiny in the face of this >> kind of hubris. > > Blocking the boot for hours and hours until we have enough entropy to > initialize the CRNG is ***not*** an acceptable way of

Re: [PATCH 05/11] Fix ERROR: space prohibited after that open parenthesis '('

2017-06-20 Thread Dan Carpenter
On Tue, Jun 20, 2017 at 01:21:46PM +0800, Jhih-Ming Huang wrote: > From: Jhih-Ming Hunag > > Fixed "ERROR: space prohibited after that open parenthesis '('". > > Signed-off-by: Jhih-Ming Hunag > --- > drivers/staging/ccree/ssi_aead.c | 16

[PATCH] crypto: sun4i-ss: support the Security System PRNG

2017-06-20 Thread Corentin Labbe
The Security System have a PRNG, this patch add support for it via crypto_rng. Signed-off-by: Corentin Labbe --- drivers/crypto/Kconfig | 8 + drivers/crypto/sunxi-ss/Makefile| 1 + drivers/crypto/sunxi-ss/sun4i-ss-core.c | 30

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Sebastian Andrzej Siewior
On 2017-06-19 22:55:37 [+0200], Jason A. Donenfeld wrote: > On Mon, Jun 19, 2017 at 9:45 AM, Sebastian Andrzej Siewior > wrote: > > ehm. You sure? I simply delayed the lock-dropping _after_ the state > > variable was been modified. So it was basically what your patch did >

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Jeffrey Walton
On Tue, Jun 20, 2017 at 4:14 AM, Jason A. Donenfeld wrote: >... > Specifically, I added `depends on DEBUG_KERNEL`. This means that these > useful warnings will only poke other kernel developers. This is probably > exactly what we want. If the various associated developers see a

Re: [PATCH 01/11] Fix coding style of driver/staging/ccree/ssi_aead.c ERROR: space required after that

2017-06-20 Thread Dan Carpenter
Subject is wrong. It should be: [PATCH 1/11] Staging: ccree: add spaces blah blah blah On Tue, Jun 20, 2017 at 01:19:44PM +0800, Jhih-Ming Huang wrote: > From: Jhih-Ming Hunag > No need. > In this series patches, I fix all of the coding style error in >

Re: [kernel-hardening] Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Michael Ellerman
Theodore Ts'o writes: > On Mon, Jun 19, 2017 at 10:57:18PM +0200, Jason A. Donenfeld wrote: >> >> With rc6 already released and rc7 coming up, I'd really appreciate you >> stepping in here and either ACKing the above commit, or giving your >> two cents about it in case I need to

Re: [PATCH 02/11] Fix ERROR: spaces required around that

2017-06-20 Thread Dan Carpenter
On Tue, Jun 20, 2017 at 01:20:59PM +0800, Jhih-Ming Huang wrote: > From: Jhih-Ming Hunag > > Fixed 'ERROR: spaces required around that' > You're breaking the patches up in a bad way. This one should be combined with the previous patch. regards, dan carpenter

Re: [PATCH] hwrng: do not warn when there are no devices

2017-06-20 Thread PrasannaKumar Muralidharan
On 20 June 2017 at 00:33, Mike Frysinger wrote: > On Mon, Jun 19, 2017 at 2:43 AM, PrasannaKumar Muralidharan wrote: >> On 19 June 2017 at 11:51, Herbert Xu wrote: >>> On Sun, Jun 18, 2017 at 10:00:17PM -0700, Mike Frysinger wrote: in order to make tpm-rng react in

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Jason A. Donenfeld
On Tue, Jun 20, 2017 at 10:33 AM, Jeffrey Walton wrote: > I think it is a bad idea to suppress all messages from a security > engineering point of view. > > Many folks don't run debug kernels. Most of the users who want or need > to know of the issues won't realize its

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Jason A. Donenfeld
Hey Ted, On Tue, Jun 20, 2017 at 02:03:44AM -0400, Theodore Ts'o wrote: > I actually had set up an earlier version of your patch for on Saturday > while I was in Beijing. (Like Linus, I'm attending the LinuxCon China > conference Monday and Tuesday.) I had even created the signed tag, > I've

Re: [kernel-hardening] Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Joel Stanley
On Tue, Jun 20, 2017 at 3:33 PM, Theodore Ts'o wrote: > On Mon, Jun 19, 2017 at 10:57:18PM +0200, Jason A. Donenfeld wrote: >> >> With rc6 already released and rc7 coming up, I'd really appreciate you >> stepping in here and either ACKing the above commit, or giving your >> two

Re: [PATCH 01/11] Fix coding style of driver/staging/ccree/ssi_aead.c ERROR: space required after that

2017-06-20 Thread Joe Perches
On Tue, 2017-06-20 at 11:20 +0300, Dan Carpenter wrote: > On Tue, Jun 20, 2017 at 01:19:44PM +0800, Jhih-Ming Huang wrote: [] > > In this series patches, I fix all of the coding style error in > > driver/staging/ccree/ssi_aead.c from 54 errors to 0 error. > > You could put this into the cover

Re: [PATCH v2 0/3] add support of hardware random generator on MediaTek MT7622

2017-06-20 Thread Sean Wang
Hi Herbert, thanks for effort reviewing on those patches. By the way, also loop in Torsten Could you kindly guide me how to determine appropriate rng->ops.quality value used by the driver? There is less clues since the value is not being set in most drivers. But good value decided would allow

Re: [kernel-hardening] Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Jason A. Donenfeld
On Tue, Jun 20, 2017 at 8:14 PM, Kees Cook wrote: > How about doing this: > >default DEBUG_KERNEL > > Most distro kernel select DEBUG_KERNEL because it unhides a bunch of > other useful configs. Since it doesn't strictly _depend_ on > DEBUG_KERNEL, I think it's probably

Re: [PATCH] staging: ccree: fix coding style error

2017-06-20 Thread Dan Carpenter
On Tue, Jun 20, 2017 at 10:51:58PM +0800, Jhih-Ming Huang wrote: > > Hi, > > This patch fix all coding style error in driver/staging/ccree/ssi_aead.c. Much better. Thanks! regards, dan carpenter

[PATCH 2/6] staging: ccree: move brace { to previous line for if.

2017-06-20 Thread Jhih-Ming Huang
From: Jhih-Ming Hunag Move brace { to previous line for if. Signed-off-by: Jhih-Ming Hunag --- drivers/staging/ccree/ssi_aead.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c

[PATCH 1/6] Staging: ccree: add space around comma, brace and operator.

2017-06-20 Thread Jhih-Ming Huang
From: Jhih-Ming Hunag Add space around comma, brace, and opertor. Signed-off-by: Jhih-Ming Hunag --- drivers/staging/ccree/ssi_aead.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git

[PATCH 3/6] staging: ccree: move '{' to next line for function.

2017-06-20 Thread Jhih-Ming Huang
From: Jhih-Ming Hunag Move '{' to next line for function. Signed-off-by: Jhih-Ming Hunag --- drivers/staging/ccree/ssi_aead.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c

[PATCH 5/6] staging: ccree: remove improper space

2017-06-20 Thread Jhih-Ming Huang
From: Jhih-Ming Hunag Remove improper space. Signed-off-by: Jhih-Ming Hunag --- drivers/staging/ccree/ssi_aead.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c

[PATCH 6/6] staging: ccree: move else to follow close brace '}'

2017-06-20 Thread Jhih-Ming Huang
From: Jhih-Ming Hunag Move else to follow close brace '}' Signed-off-by: Jhih-Ming Hunag --- drivers/staging/ccree/ssi_aead.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c

[PATCH] staging: ccree: fix coding style error

2017-06-20 Thread Jhih-Ming Huang
Hi, This patch fix all coding style error in driver/staging/ccree/ssi_aead.c.

[PATCH 4/6] staging: ccree: move * to close variable name instead of type.

2017-06-20 Thread Jhih-Ming Huang
From: Jhih-Ming Hunag Move * to close variable name instead of type. Signed-off-by: Jhih-Ming Hunag --- drivers/staging/ccree/ssi_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_aead.c

Re: [PATCH] crypto: cavium: make several functions static

2017-06-20 Thread David Miller
From: Colin King Date: Tue, 20 Jun 2017 11:35:50 +0100 > From: Colin Ian King > > The functions cvm_encrypt, cvm_decrypt, cvm_xts_setkey and > cvm_enc_dec_init does not need to be in global scope, so make > them static. > > Signed-off-by:

Re: [PATCH v2 0/3] add support of hardware random generator on MediaTek MT7622

2017-06-20 Thread Torsten Duwe
On Tue, Jun 20, 2017 at 10:21:17PM +0800, Sean Wang wrote: > Hi Herbert, > > thanks for effort reviewing on those patches. > > By the way, also loop in Torsten > > Could you kindly guide me how to determine appropriate > rng->ops.quality value used by the driver? > > I have tested with

Re: [PATCH v2 0/3] add support of hardware random generator on MediaTek MT7622

2017-06-20 Thread Sean Wang
On Tue, 2017-06-20 at 16:59 +0200, Torsten Duwe wrote: > On Tue, Jun 20, 2017 at 10:21:17PM +0800, Sean Wang wrote: > > Hi Herbert, > > > > thanks for effort reviewing on those patches. > > > > By the way, also loop in Torsten > > > > Could you kindly guide me how to determine appropriate > >

Re: [kernel-hardening] Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Sandy Harris
On Tue, Jun 20, 2017 at 5:49 AM, Jeffrey Walton wrote: > On Tue, Jun 20, 2017 at 5:36 AM, Theodore Ts'o wrote: >> On Tue, Jun 20, 2017 at 10:53:35AM +0200, Jason A. Donenfeld wrote: >>> > Suppressing all messages for all configurations cast a wider net than

Re: [kernel-hardening] Re: [PATCH] random: silence compiler warnings and fix race

2017-06-20 Thread Kees Cook
On Tue, Jun 20, 2017 at 10:50 AM, Sandy Harris wrote: > On Tue, Jun 20, 2017 at 5:49 AM, Jeffrey Walton wrote: >> On Tue, Jun 20, 2017 at 5:36 AM, Theodore Ts'o wrote: >>> On Tue, Jun 20, 2017 at 10:53:35AM +0200, Jason A. Donenfeld