[PATCH] crypto: testmgr: use consistent format for errors

2017-06-04 Thread Gilad Ben-Yossef
Fix inconsistent format and spelling in hash tests error messages. Signed-off-by: Gilad Ben-Yossef --- crypto/testmgr.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 6f5f3ed..8c68c99 100644

[PATCH RFC v2 2/8] random: add get_random_{bytes,u32,u64,int,long,once}_wait family

2017-06-04 Thread Jason A. Donenfeld
These functions are simple convenience wrappers that call wait_for_random_bytes before calling the respective get_random_* function. Signed-off-by: Jason A. Donenfeld --- include/linux/net.h| 2 ++ include/linux/once.h | 2 ++ include/linux/random.h | 25

[PATCH RFC v2 1/8] random: add synchronous API for the urandom pool

2017-06-04 Thread Jason A. Donenfeld
This enables users of get_random_{bytes,u32,u64,int,long} to wait until the pool is ready before using this function, in case they actually want to have reliable randomness. Signed-off-by: Jason A. Donenfeld --- drivers/char/random.c | 41

[PATCH RFC v2 8/8] ceph: ensure RNG is seeded before using

2017-06-04 Thread Jason A. Donenfeld
Ceph uses the RNG for various nonce generations, and it shouldn't accept using bad randomness. So, we wait for the RNG to be properly seeded. We do this by calling wait_for_random_bytes() in a function that is certainly called in process context, early on, so that all subsequent calls to

[PATCH RFC v2 4/8] crypto/rng: ensure that the RNG is ready before using

2017-06-04 Thread Jason A. Donenfeld
Otherwise, we might be seeding the RNG using bad randomness, which is dangerous. Cc: Herbert Xu Signed-off-by: Jason A. Donenfeld --- crypto/rng.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/rng.c b/crypto/rng.c

[PATCH RFC v2 5/8] security/keys: ensure RNG is seeded before use

2017-06-04 Thread Jason A. Donenfeld
Otherwise, we might use bad random numbers which, particularly in the case of IV generation, could be quite bad. It makes sense to use the synchronous API here, because we're always in process context (as the code is littered with GFP_KERNEL and the like). Signed-off-by: Jason A. Donenfeld

[PATCH RFC v2 7/8] bluetooth/smp: ensure RNG is properly seeded before ECDH use

2017-06-04 Thread Jason A. Donenfeld
This protocol uses lots of complex cryptography that relies on securely generated random numbers. Thus, it's important that the RNG is actually seeded before use. Fortuantely, it appears we're always operating in process context (there are many GFP_KERNEL allocations and other sleeping

[PATCH RFC v2 6/8] iscsi: ensure RNG is seeded before use

2017-06-04 Thread Jason A. Donenfeld
It's not safe to use weak random data here, especially for the challenge response randomness. Since we're always in process context, it's safe to simply wait until we have enough randomness to carry out the authentication correctly. While we're at it, we clean up a small memleak during an error

[PATCH RFC v2 3/8] random: warn when kernel uses unseeded randomness

2017-06-04 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

[PATCH RFC v2 0/8] get_random_bytes_wait family of APIs

2017-06-04 Thread Jason A. Donenfeld
As discussed in [1], there is a problem with get_random_bytes being used before the RNG has actually been seeded. The solution for fixing this appears to be multi-pronged. One of those prongs involves adding a simple blocking API so that modules that use the RNG in process context can just sleep

[PATCH] Drivers: ccree - style fix, spaces and tabs

2017-06-04 Thread Derek Robson
Changed code indent to be tabs across whole driver Found using checkpatch Signed-off-by: Derek Robson --- drivers/staging/ccree/ssi_cipher.c | 45 +- drivers/staging/ccree/ssi_driver.c | 6 ++--- drivers/staging/ccree/ssi_driver.h

workqueue list corruption

2017-06-04 Thread Cong Wang
Hello, On Tue, Apr 18, 2017 at 8:08 PM, Samuel Holland wrote: > Representative backtraces follow (the warnings come in sets). I have > kernel .configs and extended netconsole output from several occurrences > available upon request. > > WARNING: CPU: 1 PID: 0 at

[PATCH] crypto: brcm: fix spelling mistake: "fallbck" -> "fallback"

2017-06-04 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in flow_log message Signed-off-by: Colin Ian King --- drivers/crypto/bcm/cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/bcm/cipher.c

Re: [PATCH 1/4] Staging: ccree: cc_crypto_ctx.h: Added * on subsequent lines of a comment block.

2017-06-04 Thread Greg KH
On Sun, Jun 04, 2017 at 05:02:08AM +0530, srishti sharma wrote: > Added * on subsequent lines of a comment block. > > Signed-off-by: srishti sharma > --- > drivers/staging/ccree/cc_crypto_ctx.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) This whole series

Re: [PATCH] Staging: ccree: ssi_aead.h: Fixed a comment coding style issue.

2017-06-04 Thread Greg KH
On Sat, Jun 03, 2017 at 06:04:59PM +0530, srishti sharma wrote: > Fixed a comment coding style issue , block comments use * on subsequent lines. > > Signed-off-by: srishti sharma > --- > drivers/staging/ccree/ssi_aead.h | 5 +++-- > 1 file changed, 3 insertions(+), 2

[PATCH v3 03/18] staging: ccree: remove 48 bit dma addr sim

2017-06-04 Thread Gilad Ben-Yossef
Remove no longer needed code used to simulate 48 bit dma addresses on 32 bit platforms for development purposes. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 19 drivers/staging/ccree/ssi_buffer_mgr.c | 83

[PATCH v3 04/18] staging: ccree: refactor LLI access macros

2017-06-04 Thread Gilad Ben-Yossef
The Linked List Item descriptors were being programmed via a set of macros which suffer a few problems: - Use of macros rather than inline leaves out parameter type checking and risks multiple macro parameter evaluation side effects. - Implemented via hand rolled versions of bitfield

[PATCH v3 08/18] staging: ccree: move request_mgr to generic bitfield ops

2017-06-04 Thread Gilad Ben-Yossef
request_mgr was using custom bit field macros. move over to standard kernel bitfield ops. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_regs.h | 5 + drivers/staging/ccree/ssi_request_mgr.c | 27 +-- 2 files changed, 22

[PATCH v3 07/18] staging: ccree: remove cycle count debug support

2017-06-04 Thread Gilad Ben-Yossef
The ccree driver had support for rough performance debugging via cycle counting which has bit rotted and can easily be replcaed with perf. Remove it from the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 14

[PATCH v3 10/18] staging: ccree: remove unused struct

2017-06-04 Thread Gilad Ben-Yossef
struct SepHashPrivateContext is not used anywhere in the code. Remove it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/hash_defs.h | 18 -- 1 file changed, 18 deletions(-) diff --git a/drivers/staging/ccree/hash_defs.h

[PATCH v3 11/18] staging: ccree: use snake_case for hash enums

2017-06-04 Thread Gilad Ben-Yossef
Hash enum were named using CamelCase, move over to snake_case. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 4 ++-- drivers/staging/ccree/hash_defs.h| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v3 13/18] staging: ccree: remove dead code

2017-06-04 Thread Gilad Ben-Yossef
Remove some unused macro definitions from hash definitions. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/hash_defs.h | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/drivers/staging/ccree/hash_defs.h

[PATCH v3 12/18] staging: ccree: drop no longer used macro

2017-06-04 Thread Gilad Ben-Yossef
MSB64 macro is no longer used or needed. Drop it. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/ccree/cc_hw_queue_defs.h b/drivers/staging/ccree/cc_hw_queue_defs.h index

[PATCH v3 09/18] staging: ccree: remove custom bitfield macros

2017-06-04 Thread Gilad Ben-Yossef
With all users removed or re-factored to use the standard kernel bit fields ops we can now drop the custom bit field macros. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_bitops.h| 39 -- drivers/staging/ccree/cc_hw_queue_defs.h | 2

[PATCH v3 14/18] staging: ccree: remove spurious blank line

2017-06-04 Thread Gilad Ben-Yossef
Remove spurious blank line from cc_regs.h Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_regs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/ccree/cc_regs.h b/drivers/staging/ccree/cc_regs.h index 53675e3..4a893a6 100644 ---

[PATCH v3 16/18] staging: ccree: remove last remnants of sash algo

2017-06-04 Thread Gilad Ben-Yossef
The hash code had some left overs from a misguided attempt to support shash API with the HW. Remove the code handling this. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 448 +++ 1 file changed, 127 insertions(+),

[PATCH v3 15/18] staging: ccree: fix wrong whitespace usage

2017-06-04 Thread Gilad Ben-Yossef
Some of the register definition files had none kernel coding style usage of tabs vs. spaces in macro definitions. This patch fixes them. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/dx_crys_kernel.h | 308 -

[PATCH v3 18/18] staging: ccree: remove descriptor context definitions

2017-06-04 Thread Gilad Ben-Yossef
Remove definitions of descriptor context which are not used in the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 86 --- 1 file changed, 86 deletions(-) diff --git a/drivers/staging/ccree/cc_crypto_ctx.h

[PATCH v3 17/18] staging: ccree: remove last remnants of sblkcipher

2017-06-04 Thread Gilad Ben-Yossef
The cipher code had some left overs of an attempt to support synch. cipher API with the HW. Remove the code handling this. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 102 +++-- drivers/staging/ccree/ssi_driver.h

[PATCH v3 05/18] staging: ccree: move M/LLI defines to header file

2017-06-04 Thread Gilad Ben-Yossef
A bunch of macros used to define M/LLI descriptors where being defined in the C file. Move them over to private include file where other relevant definitions are stored. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_lli_defs.h| 8

[PATCH v3 06/18] staging: ccree: remove unused debug macros

2017-06-04 Thread Gilad Ben-Yossef
The DUMP_SGL() and DUMP_MLLI_TABLE() debug macros were defined but not used anywhere and the difference of their definitions for debug vs. none debug indicated this has not being used in a while. Remove the dead code. Signed-off-by: Gilad Ben-Yossef ---

[PATCH v3 01/18] staging: ccree: replace bit shift with BIT macro

2017-06-04 Thread Gilad Ben-Yossef
CC_CTX_SIZE was being defined using a hand rolled bit shift operation. Replace with use of BIT macro. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 00/18] additional driver cleanups

2017-06-04 Thread Gilad Ben-Yossef
This is another batch of clean ups for the ccree driver. Mostly comprised of: - Coding Style fixes - Move to kernel infrastructure from custom constructs - Replace macros with static inline functions - Removal of dead code Changes from v2: - Rebase on top of commit

Re: get_random_bytes returns bad randomness before seeding is complete

2017-06-04 Thread Stephan Müller
Am Freitag, 2. Juni 2017, 16:59:56 CEST schrieb Jason A. Donenfeld: Hi Jason, > Alternatively, I'm open to other solutions people might come up with. One addition, there is an issue (I would call it a bug) in random.c before 4.8 where the nonblocking_pool is not reseeded during early boot even