[PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Arnd Bergmann
The newly added AES GCM implementation uses one of the largest stack frames in the kernel, around 1KB on normal 64-bit kernels, and 1.6KB when CONFIG_KASAN is enabled: drivers/crypto/ccp/ccp-ops.c: In function 'ccp_run_aes_gcm_cmd': drivers/crypto/ccp/ccp-ops.c:851:1: error: the frame size of

[PATCH 2/2] crypto: ccp - Mark driver as little-endian only

2017-03-28 Thread Arnd Bergmann
The driver causes a warning when built as big-endian: drivers/crypto/ccp/ccp-dev-v5.c: In function 'ccp5_perform_des3': include/uapi/linux/byteorder/big_endian.h:32:26: error: large integer implicitly truncated to unsigned type [-Werror=overflow] #define __cpu_to_le32(x) ((__force

Re: [PATCH] arm64: dts: ls1012a: add crypto node

2017-03-28 Thread Shawn Guo
On Tue, Mar 28, 2017 at 07:19:43AM +, Horia Geantă wrote: > For the sake of current patch, please clarify whether a v2 is needed. > IIUC: > -sec_mon node name could stay the same (existing binding) > -label names are ok, since underline is the only option allowed by DTC > -alias names are

[PATCH v2] arm64: dts: ls1012a: add crypto node

2017-03-28 Thread Horia Geantă
LS1012A has a SEC v5.4 security engine. Signed-off-by: Horia Geantă --- v2: move aliases from board specific files into the shared dtsi. arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 100 - 1 file changed, 99 insertions(+), 1 deletion(-) diff

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

2017-03-28 Thread Ard Biesheuvel
On 28 March 2017 at 06:43, Eric Biggers wrote: > Hi Ard, > > On Sun, Mar 26, 2017 at 07:49:01PM +0100, Ard Biesheuvel wrote: >> 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

Re: [PATCH] arm64: dts: ls1012a: add crypto node

2017-03-28 Thread Horia Geantă
On 3/24/2017 4:04 PM, Shawn Guo wrote: > On Fri, Mar 24, 2017 at 08:29:17AM +, Horia Geantă wrote: >> On 3/24/2017 9:35 AM, Shawn Guo wrote: >>> On Fri, Mar 24, 2017 at 07:17:50AM +, Horia Geantă wrote: >> +sec_mon: sec_mon@1e9 { > > Hyphen is more preferred

[PATCH 4.9 62/88] hwrng: geode - Revert managed API changes

2017-03-28 Thread Greg Kroah-Hartman
4.9-stable review patch. If anyone has any objections, please let me know. -- From: Prarit Bhargava commit 8c75704ebcac2ffa31ee7bcc359baf701b52bf00 upstream. After commit e9afc746299d ("hwrng: geode - Use linux/io.h instead of asm/io.h") the geode-rng

[RFC TLS Offload Support 00/15] cover letter

2017-03-28 Thread Aviad Yehezkel
Overview A kernel TLS Tx only socket option for TCP sockets. Similarly to the kernel TLS socket(https://lwn.net/Articles/665602), only symmetric crypto is done in the kernel, as well as TLS record framing. The handshake remains in userspace, and the negotiated cipher keys/iv are provided

[RFC TLS Offload Support 15/15] net/tls: Add software offload

2017-03-28 Thread Aviad Yehezkel
From: Ilya Lesokhin Signed-off-by: Dave Watson Signed-off-by: Ilya Lesokhin Signed-off-by: Aviad Yehezkel --- MAINTAINERS| 1 + include/net/tls.h | 44 net/tls/Makefile | 2 +-

[RFC TLS Offload Support 05/15] tcp: Add TLS socket options for TCP sockets

2017-03-28 Thread Aviad Yehezkel
This patch adds TLS_TX and TLS_RX TCP socket options. Setting these socket options will change the sk->sk_prot operations of the TCP socket. The user is responsible to prevent races between calls to the previous operations and the new operations. After successful return, data sent on this socket

[RFC TLS Offload Support 03/15] tcp: export tcp_rate_check_app_limited function

2017-03-28 Thread Aviad Yehezkel
We will use it via tls new code. Signed-off-by: Aviad Yehezkel Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny --- net/ipv4/tcp_rate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/tcp_rate.c

[RFC TLS Offload Support 01/15] tcp: Add clean acked data hook

2017-03-28 Thread Aviad Yehezkel
From: Ilya Lesokhin Called when a TCP segment is acknowledged. Could be used by application protocols who hold additional metadata associated with the stream data This is required for TLS offloads to release metadata for acknowledged TLS records. Signed-off-by: Boris

[RFC TLS Offload Support 09/15] mlx/tls: Sysfs configuration interface Configure the driver/hardware interface via sysfs.

2017-03-28 Thread Aviad Yehezkel
From: Ilya Lesokhin Signed-off-by: Guy Shapiro Signed-off-by: Ilya Lesokhin Signed-off-by: Matan Barak Signed-off-by: Aviad Yehezkel --- .../ethernet/mellanox/accelerator/tls/tls_sysfs.c

[RFC TLS Offload Support 14/15] crypto: rfc5288 aesni optimized intel routines

2017-03-28 Thread Aviad Yehezkel
From: Dave Watson The assembly routines require the AAD data to be padded out to the nearest 4 bytes. Copy the 13 byte tag to a spare assoc data area when necessary Signed-off-by: Dave Watson --- arch/x86/crypto/aesni-intel_asm.S| 6 ++

Re: [PATCH 2/2] crypto: ccp - Mark driver as little-endian only

2017-03-28 Thread Gary R Hook
Ack. Didn't reply all Sorry, Arnd. There was a krobot warning about this and I submitted a patch just now. (I thought) my mistake was (in this function) not handling the structure elements in the same manner as other functions. My patch rectifies that. On 03/28/2017 04:58 AM, Arnd

[PATCH 4.9 61/88] hwrng: amd - Revert managed API changes

2017-03-28 Thread Greg Kroah-Hartman
4.9-stable review patch. If anyone has any objections, please let me know. -- From: Prarit Bhargava commit 69db7009318758769d625b023402161c750f7876 upstream. After commit 31b2a73c9c5f ("hwrng: amd - Migrate to managed API"), the amd-rng driver uses devres

[RFC TLS Offload Support 08/15] mlx/tls: Hardware interface

2017-03-28 Thread Aviad Yehezkel
From: Ilya Lesokhin Implement the hardware interface to set up TLS offload. Signed-off-by: Guy Shapiro Signed-off-by: Ilya Lesokhin Signed-off-by: Matan Barak Signed-off-by: Haggai Eran

[RFC TLS Offload Support 06/15] tls: tls offload support

2017-03-28 Thread Aviad Yehezkel
This patch introduces TX HW offload. tls_main: contains generic logic that will be shared by both SW and HW implementations. tls_device: contains generic HW logic that is shared by all HW offload implementations. Signed-off-by: Boris Pismenny Signed-off-by: Ilya Lesokhin

[RFC TLS Offload Support 04/15] net: Add TLS offload netdevice and socket support

2017-03-28 Thread Aviad Yehezkel
From: Ilya Lesokhin This patch add a new NDO to add and delete TLS contexts on netdevices. Signed-off-by: Boris Pismenny Signed-off-by: Ilya Lesokhin Signed-off-by: Aviad Yehezkel ---

[RFC TLS Offload Support 12/15] mlx/tls: Enable MLX5_CORE_QP_SIM mode for tls

2017-03-28 Thread Aviad Yehezkel
Signed-off-by: Aviad Yehezkel Signed-off-by: Ilya Lesokhin --- drivers/net/ethernet/mellanox/accelerator/tls/tls.c | 6 ++ drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.c | 2 ++

[RFC TLS Offload Support 13/15] crypto: Add gcm template for rfc5288

2017-03-28 Thread Aviad Yehezkel
From: Dave Watson AAD data length is 13 bytes, tag is 16. Signed-off-by: Dave Watson --- crypto/gcm.c | 122 +++ crypto/tcrypt.c | 14 --- crypto/testmgr.c | 16 crypto/testmgr.h |

[RFC TLS Offload Support 11/15] mlx/tls: TLS offload driver Add the main module entrypoints and tie the module into the build system

2017-03-28 Thread Aviad Yehezkel
From: Ilya Lesokhin Signed-off-by: Guy Shapiro Signed-off-by: Ilya Lesokhin Signed-off-by: Matan Barak Signed-off-by: Haggai Eran Signed-off-by: Aviad Yehezkel ---

[RFC TLS Offload Support 02/15] tcp: export do_tcp_sendpages function

2017-03-28 Thread Aviad Yehezkel
We will use it via tls new code. Signed-off-by: Aviad Yehezkel Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny --- include/net/tcp.h | 2 ++ net/ipv4/tcp.c| 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-)

Re: [PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Gary R Hook
On 03/28/2017 04:58 AM, Arnd Bergmann wrote:> The newly added AES GCM implementation uses one of the largest stack frames in the kernel, around 1KB on normal 64-bit kernels, and 1.6KB when CONFIG_KASAN is enabled: drivers/crypto/ccp/ccp-ops.c: In function 'ccp_run_aes_gcm_cmd':

[RFC TLS Offload Support 07/15] mlx/mlx5_core: Allow sending multiple packets

2017-03-28 Thread Aviad Yehezkel
From: Ilya Lesokhin Modify mlx5e_xmit to xmit multiple packet chained using skb->next Signed-off-by: Ilya Lesokhin Signed-off-by: Aviad Yehezkel --- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 11 +-- 1 file changed,

[RFC TLS Offload Support 10/15] mlx/tls: Add mlx_accel offload driver for TLS

2017-03-28 Thread Aviad Yehezkel
From: Ilya Lesokhin Implement the transmit and receive callbacks as well as the netdev operations for adding and removing sockets. Signed-off-by: Guy Shapiro Signed-off-by: Ilya Lesokhin Signed-off-by: Matan Barak

[PATCH] crypto: ccp - Remove redundant cpu-to-le32 macros

2017-03-28 Thread Gary R Hook
Endianness is dealt with when the command descriptor is copied into the command queue. Remove any occurrences of cpu_to_le32() found elsewhere. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v5.c | 22 +++--- 1 file changed, 11 insertions(+), 11

[PATCH 4.10 075/111] hwrng: amd - Revert managed API changes

2017-03-28 Thread Greg Kroah-Hartman
4.10-stable review patch. If anyone has any objections, please let me know. -- From: Prarit Bhargava commit 69db7009318758769d625b023402161c750f7876 upstream. After commit 31b2a73c9c5f ("hwrng: amd - Migrate to managed API"), the amd-rng driver uses devres

[PATCH 4.10 076/111] hwrng: geode - Revert managed API changes

2017-03-28 Thread Greg Kroah-Hartman
4.10-stable review patch. If anyone has any objections, please let me know. -- From: Prarit Bhargava commit 8c75704ebcac2ffa31ee7bcc359baf701b52bf00 upstream. After commit e9afc746299d ("hwrng: geode - Use linux/io.h instead of asm/io.h") the geode-rng

Re: [PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Gary R Hook
On 03/28/2017 10:10 AM, Arnd Bergmann wrote: On Tue, Mar 28, 2017 at 4:15 PM, Gary R Hook wrote: On 03/28/2017 04:58 AM, Arnd Bergmann wrote:> The newly added AES GCM implementation uses one of the largest stack frames diff --git a/drivers/crypto/ccp/ccp-dev.h

Re: [PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Arnd Bergmann
On Tue, Mar 28, 2017 at 4:15 PM, Gary R Hook wrote: > On 03/28/2017 04:58 AM, Arnd Bergmann wrote:> The newly added AES GCM > implementation uses one of the largest stack frames >> diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h >> index

Re: [PATCH 2/2] crypto: ccp - Mark driver as little-endian only

2017-03-28 Thread Gary R Hook
On 03/28/2017 09:59 AM, Arnd Bergmann wrote: On Tue, Mar 28, 2017 at 4:08 PM, Gary R Hook wrote: In fact, the use of bit fields in hardware defined data structures is not portable to start with, so until all these bit fields get replaced by something else, the driver cannot

Re: [RFC TLS Offload Support 05/15] tcp: Add TLS socket options for TCP sockets

2017-03-28 Thread Tom Herbert
On Tue, Mar 28, 2017 at 6:26 AM, Aviad Yehezkel wrote: > This patch adds TLS_TX and TLS_RX TCP socket options. > > Setting these socket options will change the sk->sk_prot > operations of the TCP socket. The user is responsible to > prevent races between calls to the

Re: [PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Arnd Bergmann
On Tue, Mar 28, 2017 at 4:15 PM, Gary R Hook wrote: >> A more drastic refactoring of the driver might be needed to reduce the >> stack usage more substantially, but this patch is fairly simple and >> at least addresses the third one of the problems I mentioned, reducing the >>

Re: [PATCH 2/2] crypto: ccp - Mark driver as little-endian only

2017-03-28 Thread Arnd Bergmann
On Tue, Mar 28, 2017 at 4:08 PM, Gary R Hook wrote: >> In fact, the use of bit fields in hardware defined data structures is >> not portable to start with, so until all these bit fields get replaced >> by something else, the driver cannot work on big-endian machines, and >> I'm

Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver

2017-03-28 Thread Krzysztof Kozlowski
On Mon, Mar 27, 2017 at 03:53:03PM +0200, Stephan Müller wrote: > Am Montag, 27. März 2017, 06:23:11 CEST schrieb PrasannaKumar Muralidharan: > > Hi PrasannaKumar, > > > > Oh my, if you are right with your first guess, this is a bad DRNG design. > > > > > > Just out of curiousity: what happens

Re: [PATCH 1/2] crypto: ccp - Reduce stack frame size with KASAN

2017-03-28 Thread Gary R Hook
On 03/28/2017 10:10 AM, Arnd Bergmann wrote: -}; +} __packed __aligned(4); My gcc 4.8 doesn't understand __aligned(). Shouldn't we use #pragma(4) here? That is odd, the __aligned() macro gets defined for all compiler versions in linux/compiler.h, and the aligned attribute should work for all

[PATCH V2] crypto: ccp - Rearrange structure members to minimize size

2017-03-28 Thread Gary R Hook
The AES GCM function (in ccp-ops) requires a fair amount of stack space, which elicits a complaint when KASAN is enabled. Rearranging and packing a few structures eliminates the warning. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.h |8 1 file

Re: [PATCH v2 1/5] dt-bindings: Document STM32 CRC bindings

2017-03-28 Thread Rob Herring
On Tue, Mar 21, 2017 at 04:13:27PM +0100, Fabien Dessenne wrote: > Document device tree bindings for the STM32 CRC (crypto CRC32) > > Signed-off-by: Fabien Dessenne > --- > .../devicetree/bindings/crypto/st,stm32-crc.txt | 16 > > 1 file

Re: [PATCH v2] arm64: dts: ls1012a: add crypto node

2017-03-28 Thread Shawn Guo
On Tue, Mar 28, 2017 at 02:46:19PM +0300, Horia Geantă wrote: > LS1012A has a SEC v5.4 security engine. > > Signed-off-by: Horia Geantă Applied, thanks.

Re: [RFC PATCH v2 16/32] x86: kvm: Provide support to create Guest and HV shared per-CPU variables

2017-03-28 Thread Borislav Petkov
On Thu, Mar 02, 2017 at 10:15:36AM -0500, Brijesh Singh wrote: > Some KVM specific MSR's (steal-time, asyncpf, avic_eio) allocates per-CPU > variable at compile time and share its physical address with hypervisor. > It presents a challege when SEV is active in guest OS. When SEV is active, > guest

Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver

2017-03-28 Thread Stephan Müller
Am Dienstag, 28. März 2017, 18:48:24 CEST schrieb Krzysztof Kozlowski: Hi Krzysztof, > I tested a little bit and: > 1. Seeding with some value > 2. generating random, > 3. kcapi_rng_destroy+kcrng_init, (I cannot do a hardware reset except >reboot of entire system) > 4. seeding with the same

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

2017-03-28 Thread Eric Biggers
On Tue, Mar 28, 2017 at 09:51:54AM +0100, Ard Biesheuvel wrote: > On 28 March 2017 at 06:43, Eric Biggers wrote: > > > > Just a thought: how about renaming CRYPTO_AES to CRYPTO_AES_GENERIC, then > > renaming what you called CRYPTO_NEED_AES to CRYPTO_AES? Then all the > >

Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver

2017-03-28 Thread Krzysztof Kozlowski
On Tue, Mar 28, 2017 at 07:41:47PM +0200, Stephan Müller wrote: > Am Dienstag, 28. März 2017, 18:48:24 CEST schrieb Krzysztof Kozlowski: > > Hi Krzysztof, > > > I tested a little bit and: > > 1. Seeding with some value > > 2. generating random, > > 3. kcapi_rng_destroy+kcrng_init, (I cannot do a