[PATCH] hwrng: Clean up RNG list when last hwrng is unregisterd

2017-12-12 Thread Gary R Hook
Commit 142a27f0a731 added support for a "best" RNG, and in doing so introduced a hang from rmmod/modprobe -r when the last RNG on the list was unloaded. When the hwrng list is depleted, return the global variables to their original state and decrement all references to the object. Fixes:

[PATCH 2/2] crypto: seqiv - Remove unused alg/spawn variable

2017-12-12 Thread Corentin Labbe
This patch remove two unused variable and some dead "code" using it. Fixes: 92932d03c2b3 ("crypto: seqiv - Remove AEAD compatibility code") Signed-off-by: Corentin Labbe --- crypto/seqiv.c | 5 - 1 file changed, 5 deletions(-) diff --git a/crypto/seqiv.c

[PATCH 1/2] crypto: echainiv - Remove unused alg/spawn variable

2017-12-12 Thread Corentin Labbe
This patch remove two unused variable and some dead "code" using it. Fixes: 66008d4230f6 ("crypto: echainiv - Remove AEAD compatibility code") Signed-off-by: Corentin Labbe --- crypto/echainiv.c | 5 - 1 file changed, 5 deletions(-) diff --git a/crypto/echainiv.c

Re: [PATCH v4] ARM: dts: exynos: Add nodes for True Random Number Generator

2017-12-12 Thread Krzysztof Kozlowski
On Tue, Dec 12, 2017 at 01:09:02PM +0100, Łukasz Stelmach wrote: > Add nodes for the True Random Number Generator found in Samsung Exynos > 5250+ SoCs. > > Signed-off-by: Łukasz Stelmach > --- > Changes since v3: > > - Rebased accroding to Krzysztof Kozłowski's request >

Re: INFO: task hung in lock_sock_nested

2017-12-12 Thread Dmitry Vyukov
On Sun, Dec 10, 2017 at 2:37 PM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 51e18a453f5f59a40c721d4aeab082b4e2e9fac6 > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler:

Re: INFO: task hung in aead_recvmsg

2017-12-12 Thread Dmitry Vyukov
On Sun, Dec 10, 2017 at 2:34 PM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > ad4dac17f9d563b9e34aab78a34293b10993e9b5 > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master >

[PATCH v3 3/4] crypto: exynos - Reseed PRNG after generating 2^16 random bytes

2017-12-12 Thread Łukasz Stelmach
Reseed PRNG after reading 65 kB of randomness. Although this may reduce performance, in most cases the loss is not noticeable. Also the time based threshold for reseeding is changed to one second. Reseeding is performed whenever either limit is exceeded. Reseeding of a PRNG does not increase

[PATCH v3 4/4] crypto: exynos - Introduce mutex to prevent concurrent access to hardware

2017-12-12 Thread Łukasz Stelmach
Hardware operations like reading random numbers and setting a seed need to be conducted in a single thread. Therefore a mutex is required to prevent multiple threads (processes) from accessing the hardware at the same time. The sequence of mutex_lock() and mutex_unlock() in the

[PATCH v3 2/4] crypto: exynos - Improve performance of PRNG

2017-12-12 Thread Łukasz Stelmach
Use memcpy_fromio() instead of custom exynos_rng_copy_random() function to retrieve generated numbers from the registers of PRNG. Signed-off-by: Łukasz Stelmach --- drivers/crypto/exynos-rng.c | 31 ++- 1 file changed, 2 insertions(+), 29

[PATCH v3 0/4] Assorted changes for Exynos PRNG driver

2017-12-12 Thread Łukasz Stelmach
Hello, This is a series of patches for exynos-rng driver I've decided to create after adding support for Exynos5250+ chips. They do not strictly depend on each other, but I think it is better to send them as a single patch-set. The driver requires appropriate DT configuration introduced in

[PATCH v3 1/4] crypto: exynos - Support Exynos5250+ SoCs

2017-12-12 Thread Łukasz Stelmach
Add support for PRNG in Exynos5250+ SoCs. Signed-off-by: Łukasz Stelmach --- .../bindings/crypto/samsung,exynos-rng4.txt| 4 +++- drivers/crypto/exynos-rng.c| 27 -- 2 files changed, 28 insertions(+), 3 deletions(-)

[PATCH 02/24] staging: ccree: fix hash naming convention

2017-12-12 Thread Gilad Ben-Yossef
The hash files were using a naming convention which was inconsistent (ssi vs. cc), included a useless prefix (ssi_hash) and often used too long function names producing monster such as ssi_ahash_get_initial_digest_len_sram_addr() that made the call site hard to read. Make the code more readable

[PATCH 03/24] staging: ccree: amend hash func def for readability

2017-12-12 Thread Gilad Ben-Yossef
Func definitions in the hash implementation were did not adhere to coding style. Fix them for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git

[PATCH 06/24] staging: ccree: fix func def and decl coding style

2017-12-12 Thread Gilad Ben-Yossef
Fix functions definition and declaration indentation according to coding style guide lines for better code readability Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 5 +- drivers/staging/ccree/ssi_buffer_mgr.c | 144

[PATCH 07/24] staging: ccree: simplify expression with local var

2017-12-12 Thread Gilad Ben-Yossef
Simplify expression by using a local variable for better code readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git

[PATCH 10/24] staging: ccree: fix req mgr func def coding style

2017-12-12 Thread Gilad Ben-Yossef
Fix request manager functions definition indentation according to coding style guide lines for better code readability Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 21 + drivers/staging/ccree/ssi_request_mgr.h | 9

[PATCH 12/24] staging: ccree: fix cipher naming convention

2017-12-12 Thread Gilad Ben-Yossef
The blkcipher files were using a func naming convention which was inconsistent (ssi vs. cc), included a long prefix (ssi_ablkcipher) and often too long. Make the code more readable by switching to a simpler, consistent naming convention. Signed-off-by: Gilad Ben-Yossef ---

[PATCH 15/24] staging: ccree: fix ivgen func def coding style

2017-12-12 Thread Gilad Ben-Yossef
Fix ivgen functions definition indentation according to coding style guide lines for better code readability Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_ivgen.c | 16 +--- drivers/staging/ccree/ssi_ivgen.h | 10 +++--- 2 files changed, 8

[PATCH 14/24] staging: ccree: fix ivgen naming convention

2017-12-12 Thread Gilad Ben-Yossef
The ivgen files were using a func naming convention which was inconsistent (ssi vs. cc), included a long prefix (ssi_ivgen) and often too long. Make the code more readable by switching to a simpler, consistent naming convention. Signed-off-by: Gilad Ben-Yossef ---

[PATCH 16/24] staging: ccree: drop unsupported MULTI2 mode code

2017-12-12 Thread Gilad Ben-Yossef
Remove the code support for MULTI2 mode which is not supported by the current hardware. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_crypto_ctx.h| 17 drivers/staging/ccree/cc_hw_queue_defs.h | 2 - drivers/staging/ccree/ssi_cipher.c | 167

[PATCH 17/24] staging: ccree: remove SSI_CC_HAS_ macros

2017-12-12 Thread Gilad Ben-Yossef
Remove macro controlling build of various features. This needs to happen dynamically in registration time. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 33 - drivers/staging/ccree/ssi_buffer_mgr.c | 4

[PATCH 20/24] staging: ccree: rename vars/structs/enums from ssi_ to cc_

2017-12-12 Thread Gilad Ben-Yossef
Unify naming convention by renaming all ssi_ vars/structs/enums and variables to cc_* Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 82 +-- drivers/staging/ccree/ssi_aead.h| 14 ++--

[PATCH 22/24] staging: ccree: fix sram mgr naming convention

2017-12-12 Thread Gilad Ben-Yossef
The SRAM manager files were using a naming convention which was inconsistent (ssi vs. cc) and often too long. Make the code more readable by switching to a simpler, consistent naming convention. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 8

[PATCH 23/24] staging: ccree: simplify freeing SRAM memory address

2017-12-12 Thread Gilad Ben-Yossef
The code freeing the SRAM memory address was zeroing the address on release although there is nothing secret about it. Simplify the code by simply calling kfree directly. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_sram_mgr.c | 7 +-- 1 file changed, 1

[PATCH 24/24] staging: ccree: fix FIPS mgr naming convention

2017-12-12 Thread Gilad Ben-Yossef
The FIPS manager files were using a naming convention which was inconsistent (ssi vs. cc) and often too long. Make the code more readable by switching to a simpler, consistent naming convention. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 6

[PATCH 19/24] staging: ccree: rename all DX to CC

2017-12-12 Thread Gilad Ben-Yossef
Unify naming convention by renaming all DX macros to CC. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hw_queue_defs.h | 4 +- drivers/staging/ccree/cc_lli_defs.h | 2 +- drivers/staging/ccree/dx_crys_kernel.h | 314 +++

[PATCH 21/24] staging: ccree: fix buf mgr naming convention

2017-12-12 Thread Gilad Ben-Yossef
The buffer manager files were using a func naming convention which was inconsistent (ssi vs. cc) and often too long. Make the code more readable by switching to a simpler, consistent naming convention. Signed-off-by: Gilad Ben-Yossef ---

[PATCH 18/24] staging: ccree: rename all SSI to CC

2017-12-12 Thread Gilad Ben-Yossef
Unify naming convention by renaming all SSI macros to CC. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c| 26 +-- drivers/staging/ccree/ssi_aead.h| 6 +-- drivers/staging/ccree/ssi_buffer_mgr.c | 78

[PATCH 13/24] staging: ccree: fix cipher func def coding style

2017-12-12 Thread Gilad Ben-Yossef
Fix cipher functions definition indentation according to coding style guide lines for better code readability Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 38 +++--- 1 file changed, 15 insertions(+), 23

[PATCH 09/24] staging: ccree: fix reg mgr naming convention

2017-12-12 Thread Gilad Ben-Yossef
The request manager files were using a func naming convention which was inconsistent (ssi vs. cc), included a useless prefix (ssi_request_mgr) and often too long. Make the code more readable by switching to a simpler, consistent naming convention. Signed-off-by: Gilad Ben-Yossef

[PATCH 11/24] staging: ccree: remove cipher sync blkcipher remains

2017-12-12 Thread Gilad Ben-Yossef
Remove the remains of no longer existing support for running blkcipher is sync mode. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_cipher.c | 156 - 1 file changed, 51 insertions(+), 105 deletions(-) diff --git

[PATCH 08/24] staging: ccree: fix func call param indentation

2017-12-12 Thread Gilad Ben-Yossef
Fix function call parameter indentation according to coding style guide lines. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_buffer_mgr.c | 28 +++- drivers/staging/ccree/ssi_hash.c | 10 -- 2 files changed, 15

[PATCH 05/24] staging: ccree: shorten parameter name

2017-12-12 Thread Gilad Ben-Yossef
Shorten parameter name for better code readability Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c

[PATCH 04/24] staging: ccree: func params should follow func name

2017-12-12 Thread Gilad Ben-Yossef
Fix some call sites with func params not following func name in AEAD code. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/ccree/ssi_aead.c

[PATCH 01/24] staging: ccree: remove ahash wrappers

2017-12-12 Thread Gilad Ben-Yossef
Remove a no longer needed abstraction around ccree hash crypto API internals that used to allow same ops to be used in synchronous and asynchronous fashion. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_hash.c | 260 --- 1

[PATCH 00/24] staging: ccree: cleanups and simplification

2017-12-12 Thread Gilad Ben-Yossef
More CCREE code cleanup and simplifications, including: - Drop code supporting long code synch cipher and hash usage - Drop ifdef out code for features not supported by HW - More naming convention and name space cleanup - Coding style fixes This patch set goes on top of Dan Carpenter's patch

Re: [PATCH v2 2/4] crypto: exynos - Improve performance of PRNG

2017-12-12 Thread Łukasz Stelmach
It was <2017-12-11 pon 15:54>, when Krzysztof Kozlowski wrote: > On Mon, Dec 11, 2017 at 3:06 PM, Łukasz Stelmach > wrote: >> Cc: Marek Szyprowski , Bartlomiej >> Zolnierkiewicz > > This should not appear here. A

Re: AF_ALG: skb limits

2017-12-12 Thread Jonathan Cameron
On Fri, 8 Dec 2017 13:43:20 +0100 Stephan Mueller wrote: > Am Freitag, 8. Dezember 2017, 12:39:06 CET schrieb Jonathan Cameron: > > Hi Jonathan, > > > > > As a heads up, the other nasties we've found so far are around hitting > > limits on the various socket buffers.

[PATCH v4] ARM: dts: exynos: Add nodes for True Random Number Generator

2017-12-12 Thread Łukasz Stelmach
Add nodes for the True Random Number Generator found in Samsung Exynos 5250+ SoCs. Signed-off-by: Łukasz Stelmach --- Changes since v3: - Rebased accroding to Krzysztof Kozłowski's request arch/arm/boot/dts/exynos5.dtsi| 5 + arch/arm/boot/dts/exynos5250.dtsi |

[RFC crypto v2 9/9] Makefile Kconfig

2017-12-12 Thread Atul Gupta
Entry for Inline TLS as another driver dependent on cxgb4 and chcr Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/Kconfig| 10 ++ drivers/crypto/chelsio/Makefile | 1 + drivers/crypto/chelsio/chtls/Makefile | 4 3 files changed, 15

[RFC crypto v2 8/9] chtls: Register the ULP

2017-12-12 Thread Atul Gupta
Add new uld driver for Inline TLS support. Register ULP for chtls. Setsockopt to program key on chip. support AES GCM key size 128. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chtls/chtls_main.c | 584 ++ include/uapi/linux/tls.h

[RFC crypto v2 6/9] chtls: CPL handler definition

2017-12-12 Thread Atul Gupta
CPL handlers for TLS session, record transmit and receive. Signed-off-by: Atul Gupta --- V2: Excess Whitespace Reverse christmas tree format skb free in TCP_SYN_RECV removed !ret check export tcp_time_wait fix newsk leak in error case ---

[RFC crypto v2 7/9] chtls: Inline crypto request Tx/Rx

2017-12-12 Thread Atul Gupta
TLS handler for record transmit and receive. Create Inline TLS work request and post to FW. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chtls/chtls_io.c | 1866 +++ 1 file changed, 1866 insertions(+) create mode 100644

[RFC crypto v2 5/9] chtls: Key program

2017-12-12 Thread Atul Gupta
Program the tx and rx key on chip. Signed-off-by: Atul Gupta --- V2: using aes instead of aes-generic memset key after programming --- drivers/crypto/chelsio/chtls/chtls_hw.c | 394 1 file changed, 394 insertions(+) create mode 100644

[RFC crypto v2 3/9] cxgb4: LLD driver changes to enable TLS

2017-12-12 Thread Atul Gupta
Read FW capability. Read key area size. Dump the TLS record count. Signed-off-by: Atul Gupta --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 18 +++- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c| 32 +-- drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h

[RFC crypto v2 4/9] chcr: Key Macro

2017-12-12 Thread Atul Gupta
Define macro for TLS Key context Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_algo.h | 42 + drivers/crypto/chelsio/chcr_core.h | 55 +- 2 files changed, 96 insertions(+), 1 deletion(-) diff

[RFC crypto v2 2/9] cxgb4: Inline TLS FW Interface

2017-12-12 Thread Atul Gupta
Key area size in hw-config file. CPL struct for TLS request and response. Work request for Inline TLS. Signed-off-by: Atul Gupta --- drivers/net/ethernet/chelsio/cxgb4/t4_msg.h | 121 ++- drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | 2 +

[RFC crypto v2 1/9] chtls: structure and macro definiton

2017-12-12 Thread Atul Gupta
Inline TLS state, connection management. Supporting macros definition. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chtls/chtls.h| 480 drivers/crypto/chelsio/chtls/chtls_cm.h | 203 ++ 2 files changed, 683

[RFC crypto v2 0/9] Chelsio Inline TLS

2017-12-12 Thread Atul Gupta
RFC series for Chelsio Inline TLS driver (chtls.ko) Driver use the ULP infrastructure to register chtls as Inline TLS ULP. Chtls use TCP Sockets to transmit and receive TLS record. TCP proto_ops is extended to offload TLS record. T6 adapter provides the following features: -TLS record

[PATCH v2] crypto: artpec6: set correct iv size for gcm(aes)

2017-12-12 Thread Lars Persson
The IV size should not include the 32 bit counter. Because we had the IV size set as 16 the transform only worked when the IV input was zero padded. Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driver") Signed-off-by: Lars Persson --- v2: Use

Re: [PATCH] crypto: artpec6: set correct iv size for gcm(aes)

2017-12-12 Thread Corentin Labbe
On Tue, Dec 12, 2017 at 12:20:20PM +0100, Lars Persson wrote: > The IV size should not include the 32 bit counter. Because we had the > IV size set as 16 the transform only worked when the IV input was zero > padded. > > Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator >

[PATCH] crypto: artpec6: set correct iv size for gcm(aes)

2017-12-12 Thread Lars Persson
The IV size should not include the 32 bit counter. Because we had the IV size set as 16 the transform only worked when the IV input was zero padded. Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driver") Signed-off-by: Lars Persson ---

Re: [PATCH v2 4/4] crypto: exynos - Introduce mutex to prevent concurrent access to hardware

2017-12-12 Thread Krzysztof Kozlowski
On Tue, Dec 12, 2017 at 11:30 AM, Łukasz Stelmach wrote: > It was <2017-12-11 pon 16:03>, when Krzysztof Kozlowski wrote: >> On Mon, Dec 11, 2017 at 3:06 PM, Łukasz Stelmach >> wrote: >>> Cc: Marek Szyprowski , Bartlomiej

Re: [PATCH v3 3/3] ARM: dts: exynos: Add nodes for True Random Number Generator

2017-12-12 Thread Krzysztof Kozlowski
On Tue, Dec 12, 2017 at 11:35 AM, Łukasz Stelmach wrote: > It was <2017-12-11 pon 19:49>, when Krzysztof Kozlowski wrote: >> On Mon, Dec 04, 2017 at 01:53:51PM +0100, Łukasz Stelmach wrote: >>> Add nodes for the True Random Number Generator found in Samsung Exynos >>>

Re: [PATCH v3 3/3] ARM: dts: exynos: Add nodes for True Random Number Generator

2017-12-12 Thread Łukasz Stelmach
It was <2017-12-11 pon 19:49>, when Krzysztof Kozlowski wrote: > On Mon, Dec 04, 2017 at 01:53:51PM +0100, Łukasz Stelmach wrote: >> Add nodes for the True Random Number Generator found in Samsung Exynos >> 5250+ SoCs. >> >> Signed-off-by: Łukasz Stelmach >> --- >>

Re: [PATCH v2 4/4] crypto: exynos - Introduce mutex to prevent concurrent access to hardware

2017-12-12 Thread Łukasz Stelmach
It was <2017-12-11 pon 16:03>, when Krzysztof Kozlowski wrote: > On Mon, Dec 11, 2017 at 3:06 PM, Łukasz Stelmach > wrote: >> Cc: Marek Szyprowski , Bartlomiej Zolnierkiewicz >> >> >> Hardware operations like reading

Re: [PATCH] crypto: AF_ALG - limit mask and type

2017-12-12 Thread Stephan Mueller
Am Dienstag, 12. Dezember 2017, 09:57:37 CET schrieb Eric Biggers: Hi Eric, > Hi Stephan, > > On Tue, Dec 12, 2017 at 07:09:08AM +0100, Stephan Müller wrote: > > Hi Herbert, > > > > you see the reported problem by simply using > > > > sa.salg_mask = 0x; > > > > Note, I am not fully

Re: [PATCH] crypto: AF_ALG - limit mask and type

2017-12-12 Thread Eric Biggers
Hi Stephan, On Tue, Dec 12, 2017 at 07:09:08AM +0100, Stephan Müller wrote: > Hi Herbert, > > you see the reported problem by simply using > > sa.salg_mask = 0x; > > Note, I am not fully sure about whether CRYPTO_AF_ALG_ALLOWED_MASK and > CRYPTO_AF_ALG_ALLOWED_TYPE have the correct