Re: [PATCH] X.509: fix comparisons of ->pkey_algo

2017-11-28 Thread David Howells
Eric Biggers wrote: > if (strcmp(x509->pub->pkey_algo, sinfo->sig->pkey_algo)) Can you make this strcmp(...) != 0? I know it may seem picky, but checking strcmp() in this way kind of inverts the true/false thing. Thanks, David

[PATCH] crypto: Add myself as co-maintainer for s5p-sss.c

2017-11-28 Thread Kamil Konieczny
Add myself as co-maintainer for Samsung Security SubSystem driver. Signed-off-by: Kamil Konieczny --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index aa71ab52fd76..3f6cadf2e087 100644 --- a/MAINTAINERS +++

Re: x509 parsing bug + fuzzing crypto in the userspace

2017-11-28 Thread Dmitry Vyukov
On Fri, Nov 24, 2017 at 5:31 PM, Stephan Mueller wrote: > Am Freitag, 24. November 2017, 17:25:55 CET schrieb Dmitry Vyukov: > > Hi Dmitry, > >> Eric also pointed me to grep. But I can't say the code is intuitive. >> I've spent way more time than I expected to just get a list

Re: [PATCH] crypto: rsa - fix buffer overread when stripping leading zeroes

2017-11-28 Thread David Howells
Eric Biggers wrote: > In rsa_get_n(), if the buffer contained all 0's and "FIPS mode" is > enabled, we would read one byte past the end of the buffer while > scanning the leading zeroes. Fix it by checking 'n_sz' before '!*ptr'. Reviewed-by: David Howells

Re: [PATCH v5 2/2] crypto: stm32 - Support for STM32 CRYP crypto module

2017-11-28 Thread Fabien DESSENNE
Just a gentle ping ... or have I missed out on a reply? On 13/11/17 11:30, Fabien DESSENNE wrote: > Hi Herbert, > > Can you check if this patchset (removed the AEAD part as you suggested + > libkcapi test OK as suggested by Corentin) can be applied now? > > BR > > Fabien > > > On 07/11/17 15:40,

Re: [PATCH] X.509: fix printing uninitialized stack memory when OID is empty

2017-11-28 Thread David Howells
I wonder if all -EBADMSG returns here should just print "(badoid)" into the buffer. David

Re: [PATCH] crypto: rsa - fix buffer overread when stripping leading zeroes

2017-11-28 Thread David Howells
Hi Herbert, Are you going to take this? David

Re: general protection fault in af_alg_free_areq_sgls

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 10:10:55AM +0100, Stephan Mueller wrote: > > diff --git a/crypto/af_alg.c b/crypto/af_alg.c > > index 358749c38894..415a54ced4d6 100644 > > --- a/crypto/af_alg.c > > +++ b/crypto/af_alg.c > > @@ -672,14 +672,15 @@ void af_alg_free_areq_sgls(struct af_alg_async_req > >

[PATCH] crypto: caam/qi - use correct print specifier for size_t

2017-11-28 Thread Horia Geantă
Fix below warnings on ARMv7 by using %zu for printing size_t values: drivers/crypto/caam/caamalg_qi.c: In function aead_edesc_alloc: drivers/crypto/caam/caamalg_qi.c:417:17: warning: format %lu expects argument of type long unsigned int, but argument 4 has type unsigned int [-Wformat=]

Re: [PATCH 4/4] staging: most: Remove a attribute group from a kobject

2017-11-28 Thread Greg KH
On Sat, Nov 25, 2017 at 12:09:31PM +0530, Arvind Yadav wrote: > All attribute group created during dim2_sysfs_probe() should be removed > in dim2_sysfs_destroy(). > > Signed-off-by: Arvind Yadav > --- > drivers/staging/most/hdm-dim2/dim2_sysfs.c | 1 + This file is

[PATCH v2 1/4] crypto: inside-secure - per request invalidation

2017-11-28 Thread Antoine Tenart
From: Ofer Heifetz When an invalidation request is needed we currently override the context .send and .handle_result helpers. This is wrong as under high load other requests can already be queued and overriding the context helpers will make them execute the wrong .send and

[PATCH v2 0/4] crypto: inside-secure - set of fixes

2017-11-28 Thread Antoine Tenart
Hi Herbert, This series is a set of 4 fixes on the Inside Secure SafeXcel crypto engine driver. The series will be followed by another non-fix one. This is based on v4.15-rc1. Thanks, Antoine Since v1: - Removed the crash.txt file which was part of patch 1/4. Antoine Tenart (3): crypto:

[PATCH v2 3/4] crypto: inside-secure - only update the result buffer when provided

2017-11-28 Thread Antoine Tenart
The patch fixes the ahash support by only updating the result buffer when provided. Otherwise the driver could crash with NULL pointer exceptions, because the ahash caller isn't required to supply a result buffer on all calls. Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197

[PATCH v2 2/4] crypto: inside-secure - free requests even if their handling failed

2017-11-28 Thread Antoine Tenart
This patch frees the request private data even if its handling failed, as it would never be freed otherwise. Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver") Suggested-by: Ofer Heifetz Signed-off-by: Antoine Tenart

[PATCH v2 4/4] crypto: inside-secure - fix request allocations in invalidation path

2017-11-28 Thread Antoine Tenart
This patch makes use of the SKCIPHER_REQUEST_ON_STACK and AHASH_REQUEST_ON_STACK helpers to allocate enough memory to contain both the crypto request structures and their embedded context (__ctx). Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver")

Re: [PATCH] X.509: fix printing uninitialized stack memory when OID is empty

2017-11-28 Thread Eric Biggers
Hi David, On Tue, Nov 28, 2017 at 11:03:54AM +, David Howells wrote: > I wonder if all -EBADMSG returns here should just print "(badoid)" into the > buffer. > I don't really care either way; it's just a question of whether it's better to truncate the bad part, or print a special value. If

Re: KASAN: stack-out-of-bounds Write in sha3_final

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 05:24:00AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 0c86a6bd85ff0629cd2c5141027fc1c8bb6cde9c > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console

[PATCH v2] X.509: fix comparisons of ->pkey_algo

2017-11-28 Thread Eric Biggers
From: Eric Biggers ->pkey_algo used to be an enum, but was changed to a string by commit 4e8ae72a75aa ("X.509: Make algo identifiers text instead of enum"). But two comparisons were not updated. Fix them to use strcmp(). This bug broke signature verification in certain

Re: KASAN: slab-out-of-bounds Write in sha3_final

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 05:24:01AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 6fc478f80f6809cc4b1a4230f47a62d3b7378dc0 > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console

Re: general protection fault in scatterwalk_copychunks

2017-11-28 Thread Stephan Müller
Am Dienstag, 28. November 2017, 18:24:01 CET schrieb syzbot: Hi, > Hello, > > syzkaller hit the following crash on > 1ea8d039f9edcfefb20d8ddfe136930f6e551529 > git://git.cmpxchg.org/linux-mmots.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is

[PATCH v2] crypto: AF_ALG - race-free access of encryption flag

2017-11-28 Thread Stephan Müller
Hi Herbert, I verified the correctnes of the patch with Eric's test program. Without the patch, the issue is present. With the patch, the kernel happily lives ever after. Changes v2: change the submission into a proper patch Ciao Stephan ---8<--- The function af_alg_get_rsgl may sleep to wait

Re: KASAN: stack-out-of-bounds Write in sha3_update

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 05:23:01AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 1ea8d039f9edcfefb20d8ddfe136930f6e551529 > git://git.cmpxchg.org/linux-mmots.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is attached. > C

Re: general protection fault in crypto_remove_spawns

2017-11-28 Thread Stephan Müller
Am Montag, 27. November 2017, 19:56:46 CET schrieb syzbot: Hi Herbert, The issue seems to trigger a bug whose results we have seen before. When starting the reproducer and stopping it shortly thereafter, I see the numerous identical entries in /proc/crypto: name : cmac(des3_ede)

Re: [PATCH v2] crypto: AF_ALG - race-free access of encryption flag

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 10:33:09PM +0100, Stephan Müller wrote: > Hi Herbert, > > I verified the correctnes of the patch with Eric's test program. > Without the patch, the issue is present. With the patch, the kernel > happily lives ever after. > > Changes v2: change the submission into a proper

Re: [PATCH v2] crypto: AF_ALG - race-free access of encryption flag

2017-11-28 Thread Herbert Xu
On Tue, Nov 28, 2017 at 10:33:09PM +0100, Stephan Müller wrote: > Hi Herbert, > > I verified the correctnes of the patch with Eric's test program. > Without the patch, the issue is present. With the patch, the kernel > happily lives ever after. > > Changes v2: change the submission into a proper

Re: general protection fault in scatterwalk_copychunks

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 09:24:01AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 1ea8d039f9edcfefb20d8ddfe136930f6e551529 > git://git.cmpxchg.org/linux-mmots.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is attached. > C

Crypto Fixes for 4.15

2017-11-28 Thread Herbert Xu
Hi Linus: This push fixes the following issues: - Potential bogus alignment for some AEAD operations. - Crash in algif_aead. - Sleeping in softirq context with async af_alg. Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git linus Ondrej Mosnáček (1):

Re: [PATCH] crypto: rsa - fix buffer overread when stripping leading zeroes

2017-11-28 Thread Herbert Xu
On Tue, Nov 28, 2017 at 10:54:32AM +, David Howells wrote: > Hi Herbert, > > Are you going to take this? Yes it's in my queue. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] crypto: salsa20 - fix blkcipher_walk API usage

2017-11-28 Thread Herbert Xu
On Tue, Nov 28, 2017 at 08:56:59PM -0800, Eric Biggers wrote: > From: Eric Biggers > > When asked to encrypt or decrypt 0 bytes, both the generic and x86 > implementations of Salsa20 crash in blkcipher_walk_done(), either when > doing 'kfree(walk->buffer)' or

Re: crypto: tcrypt - set assoc in sg_init_aead()

2017-11-28 Thread Herbert Xu
On Tue, Nov 14, 2017 at 04:59:15PM +0200, Tudor-Dan Ambarus wrote: > Results better code readability. > > Signed-off-by: Tudor Ambarus > Reviewed-by: Horia Geantă Patch applied. Thanks. -- Email: Herbert Xu Home

Re: [v2,01/12] hwrng: bcm2835 - Obtain base register via resource

2017-11-28 Thread Herbert Xu
On Tue, Nov 07, 2017 at 04:44:38PM -0800, Florian Fainelli wrote: > In preparation for consolidating bcm63xx-rng into bcm2835-rng, make sure > that we obtain the base register via platform_get_resource() since we > need to support the non-DT enabled MIPS-based BCM63xx DSL SoCs. > > Signed-off-by:

Re: [PATCH] crypto: chelsio - Fix an error code in chcr_hash_dma_map()

2017-11-28 Thread Herbert Xu
On Fri, Nov 10, 2017 at 12:25:43AM +0300, Dan Carpenter wrote: > The dma_map_sg() function returns zero on error and positive values on > success. We want to return -ENOMEM on failure here and zero on success. > > Fixes: 2f47d5804311 ("crypto: chelsio - Move DMA un/mapping to chcr from lld >

Re: [PATCH] crypto: s5p-sss - Remove a stray tab

2017-11-28 Thread Herbert Xu
On Fri, Nov 10, 2017 at 12:26:04AM +0300, Dan Carpenter wrote: > This code seems correct, but the goto was indented too far. > > Signed-off-by: Dan Carpenter Patch applied. Thanks. -- Email: Herbert Xu Home Page:

Re: [PATCH] crypto: chelsio: remove redundant assignments to reqctx and dst_size

2017-11-28 Thread Herbert Xu
On Thu, Nov 09, 2017 at 08:54:13AM +, Colin King wrote: > From: Colin Ian King > > Pointer reqctx is assigned the same value twice, once on initialization > and again a few statements later, remove the second redundant assignment. > Variable dst_size is assigned but

Re: [PATCH] Fix NULL pointer deref. on no default_rng

2017-11-28 Thread Herbert Xu
On Sun, Nov 12, 2017 at 03:24:32PM +0100, Pierre Ducroquet wrote: > If crypto_get_default_rng returns an error, the > function ecc_gen_privkey should return an error. > Instead, it currently tries to use the default_rng > nevertheless, thus creating a kernel panic with a > NULL pointer

Re: [PATCH] crypto: replace FSF address with web source in license notices

2017-11-28 Thread Herbert Xu
On Tue, Nov 14, 2017 at 10:25:15AM +0100, Martin Kepplinger wrote: > A few years ago the FSF moved and "59 Temple Place" is wrong. Having this > still in our source files feels old and unmaintained. > > Let's take the license statement serious and not confuse users. > > As

Re: [PATCH v2] ARM64: crypto: do not call crypto_unregister_skcipher twice on error

2017-11-28 Thread Herbert Xu
On Fri, Nov 24, 2017 at 08:22:07AM +, Corentin Labbe wrote: > When a cipher fails to register in aes_init(), the error path goes thought > aes_exit() then crypto_unregister_skciphers(). > Since aes_exit calls also crypto_unregister_skcipher, this triggers a > refcount_t: underflow;

Re: [PATCHi v2] dt-bindings: add device tree binding for Arm TrustZone CryptoCell crypto engine

2017-11-28 Thread Herbert Xu
On Thu, Nov 16, 2017 at 06:15:28AM +, Gilad Ben-Yossef wrote: > The Arm TrustZone CryptoCell is a hardware security engine. This patch > adds DT bindings for its Rich Execution Environment crypto engine. > > A driver supporting this device is already present in the staging tree. > >

Re: [PATCH net-next] cryptd: Add cryptd_max_cpu_qlen module parameter

2017-11-28 Thread Herbert Xu
On Wed, Nov 22, 2017 at 04:08:17PM +1100, Jon Maxwell wrote: > Make the cryptd queue length configurable. We recently had customer where > this > needed to be tuned to accommodate the aesni_intel module and prevent packet > drop. > > Signed-off-by: Jon Maxwell Patch

Re: [PATCH] crypto/arm64: aes-ce-cipher - move assembler code to .S file

2017-11-28 Thread Herbert Xu
On Tue, Nov 21, 2017 at 01:40:17PM +, Ard Biesheuvel wrote: > Most crypto drivers involving kernel mode NEON take care to put the code > that actually touches the NEON register file in a separate compilation > unit, to prevent the compiler from reordering code that preserves or > restores the

Re: [PATCH 0/5] crypto: chacha20 - Alignment fixes

2017-11-28 Thread Herbert Xu
On Wed, Nov 22, 2017 at 11:51:34AM -0800, Eric Biggers wrote: > From: Eric Biggers > > This series fixes potentially unaligned memory accesses when loading the > initial state, key, and IV for ChaCha20, and when outputting each > keystream block. > > It also removes the

Re: [PATCH v5 0/2] STM32 CRYP crypto driver

2017-11-28 Thread Herbert Xu
On Thu, Oct 19, 2017 at 05:10:28PM +0200, Fabien Dessenne wrote: > This set of patches adds a new crypto driver for STMicroelectronics stm32 HW. > This drivers uses the crypto API and provides with HW-enabled block cipher > algorithms. > > This driver was successfully tested with tcrypt /

Re: [PATCH v2] crypto: AF_ALG - race-free access of encryption flag

2017-11-28 Thread Herbert Xu
On Wed, Nov 29, 2017 at 07:48:53AM +0100, Stephan Mueller wrote: > Am Mittwoch, 29. November 2017, 00:02:40 CET schrieb Herbert Xu: > > > This is wrong. You can't fetch ctx->enc before you wait. It has > > to be done after the wait as otherwise ctx->enc may not even have > > been initialised. >

Re: [1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-28 Thread Herbert Xu
On Tue, Oct 10, 2017 at 01:21:59PM +0300, Robert Baronescu wrote: > In case buffer length is a multiple of PAGE_SIZE, > the S/G table is incorrectly generated. > Fix this by handling buflen = k * PAGE_SIZE separately. > > Signed-off-by: Robert Baronescu Patch applied.

Re: [PATCH] crypto: keywrap - Add missing ULL suffixes for 64-bit constants

2017-11-28 Thread Herbert Xu
On Wed, Nov 15, 2017 at 11:44:28AM +0100, Geert Uytterhoeven wrote: > On 32-bit (e.g. with m68k-linux-gnu-gcc-4.1): > > crypto/keywrap.c: In function ‘crypto_kw_decrypt’: > crypto/keywrap.c:191: warning: integer constant is too large for ‘long’ > type > crypto/keywrap.c: In function

Re: [crypto v3 2/2] chcr: Add support for Inline IPSec

2017-11-28 Thread Herbert Xu
On Thu, Nov 16, 2017 at 04:57:08PM +0530, Atul Gupta wrote: > register xfrmdev_ops callbacks, Send IPsec tunneled data > to HW for inline processing. > The driver use hardware crypto accelerator to encrypt and > generate ICV for the transmitted packet in Inline mode. > > Signed-off-by: Atul Gupta

Re: [5/8] crypto: remove unused hardirq.h

2017-11-28 Thread Herbert Xu
On Sat, Nov 18, 2017 at 07:02:18AM +0800, Yang Shi wrote: > Preempt counter APIs have been split out, currently, hardirq.h just > includes irq_enter/exit APIs which are not used by crypto at all. > > So, remove the unused hardirq.h. > > Signed-off-by: Yang Shi > Cc:

Re: [PATCH] crypto: cavium: fix memory leak on info

2017-11-28 Thread Herbert Xu
On Wed, Nov 15, 2017 at 12:37:19PM +, Colin King wrote: > From: Colin Ian King > > The object info is being leaked on an error return path, fix this > by setting ret to -ENOMEM and exiting via the request_cleanup path > that will free info. > > Detected by

Re: [PATCH] crypto: hifn_795x - Fix a memory leak in the error handling path of 'hifn_probe()'

2017-11-28 Thread Herbert Xu
On Sat, Nov 18, 2017 at 02:45:45PM +0100, Christophe JAILLET wrote: > 'dev' is leaking in the error handling path of 'hifn_probe()'. > > Add a 'kfree(dev)' to match the code in 'hifn_remove()' > > Signed-off-by: Christophe JAILLET Patch applied. Thanks. --

Re: [crypto v3 1/2] cxgb4: Add support for Inline IPSec Tx

2017-11-28 Thread Herbert Xu
On Thu, Nov 16, 2017 at 04:56:39PM +0530, Atul Gupta wrote: > Added Tx routine for ULD > - define interface for ULD Tx. > > Export routines used for Tx data > - Routines common for data transmit are used by cxgb4 and chcr > drivers. > - EXPORT routines enable transmit from chcr driver. > >

Re: [PATCH v2] crypto: AF_ALG - race-free access of encryption flag

2017-11-28 Thread Stephan Mueller
Am Mittwoch, 29. November 2017, 08:10:49 CET schrieb Herbert Xu: Hi Herbert, > > But anyway this isn't suitable for stable where we should just fix > it by making it not crash. I will send a patch right away moving the wait out. Later on I will elaborate on your suggestion to move the

[PATCH] crypto: salsa20 - fix blkcipher_walk API usage

2017-11-28 Thread Eric Biggers
From: Eric Biggers When asked to encrypt or decrypt 0 bytes, both the generic and x86 implementations of Salsa20 crash in blkcipher_walk_done(), either when doing 'kfree(walk->buffer)' or 'free_page((unsigned long)walk->page)', because walk->buffer and walk->page have not

Re: kernel BUG at ./include/linux/mm.h:LINE! (2)

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 09:24:01AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 1d3b78bbc6e983fabb3fbf91b76339bf66e4a12c > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console

Re: suspicious RCU usage at ./include/trace/events/kmem.h:LINE

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 06:22:01AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 1d3b78bbc6e983fabb3fbf91b76339bf66e4a12c > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console

Re: suspicious RCU usage at ./include/linux/mm.h:LINE

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 07:23:01AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 1d3b78bbc6e983fabb3fbf91b76339bf66e4a12c > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console

Re: [PATCH] crypto: replace FSF address with web source in license notices

2017-11-28 Thread Philippe Ombredanne
On Wed, Nov 29, 2017 at 7:35 AM, Herbert Xu wrote: > On Tue, Nov 14, 2017 at 10:25:15AM +0100, Martin Kepplinger wrote: >> A few years ago the FSF moved and "59 Temple Place" is wrong. Having this >> still in our source files feels old and unmaintained. >> >> Let's

Re: [PATCH] crypto: rsa - fix buffer overread when stripping leading zeroes

2017-11-28 Thread Herbert Xu
Eric Biggers wrote: > From: Eric Biggers > > In rsa_get_n(), if the buffer contained all 0's and "FIPS mode" is > enabled, we would read one byte past the end of the buffer while > scanning the leading zeroes. Fix it by checking 'n_sz' before '!*ptr'.

Re: KASAN: use-after-free Read in aead_recvmsg

2017-11-28 Thread Herbert Xu
On Mon, Nov 27, 2017 at 11:29:44PM -0800, Eric Biggers wrote: > > >From 453b54793e843c0d5b8fd2d5e33fcc5427ec038e Mon Sep 17 00:00:00 2001 > From: Eric Biggers > Date: Mon, 27 Nov 2017 23:23:05 -0800 > Subject: [PATCH] crypto: algif_aead - fix reference counting of null

Re: general protection fault in af_alg_free_areq_sgls

2017-11-28 Thread Herbert Xu
On Tue, Nov 28, 2017 at 01:02:52AM -0800, Eric Biggers wrote: > > >From 1a7a7f86f09c50652f1fff75b8d3a32712826b32 Mon Sep 17 00:00:00 2001 > From: Eric Biggers > Date: Tue, 28 Nov 2017 00:46:24 -0800 > Subject: [PATCH] crypto: af_alg - fix NULL pointer dereference in >

Re: [PATCH v2] crypto: hmac - require that the underlying hash algorithm is unkeyed

2017-11-28 Thread Herbert Xu
On Tue, Nov 28, 2017 at 06:01:38PM -0800, Eric Biggers wrote: > From: Eric Biggers > > Because the HMAC template didn't check that its underlying hash > algorithm is unkeyed, trying to use "hmac(hmac(sha3-512-generic))" > through AF_ALG or through KEYCTL_DH_COMPUTE resulted

Re: [PATCH][V2] crypto/nx: fix spelling mistake: "availavle" -> "available"

2017-11-28 Thread Herbert Xu
On Tue, Nov 14, 2017 at 02:32:17PM +, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in pr_err error message text. Also > fix spelling mistake in proceeding comment. > > Signed-off-by: Colin Ian King Patch

Re: KASAN: slab-out-of-bounds Write in sha3_update

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 12:45:01PM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console

Re: KASAN: stack-out-of-bounds Write in sha3_update

2017-11-28 Thread Eric Biggers
On Tue, Nov 28, 2017 at 12:58:45PM -0800, Eric Biggers wrote: > diff --git a/crypto/hmac.c b/crypto/hmac.c > index 92871dc2a63e..82436db6b6a6 100644 > --- a/crypto/hmac.c > +++ b/crypto/hmac.c > @@ -196,6 +196,11 @@ static int hmac_create(struct crypto_template *tmpl, > struct rtattr **tb) >

[PATCH v2] crypto: hmac - require that the underlying hash algorithm is unkeyed

2017-11-28 Thread Eric Biggers
From: Eric Biggers Because the HMAC template didn't check that its underlying hash algorithm is unkeyed, trying to use "hmac(hmac(sha3-512-generic))" through AF_ALG or through KEYCTL_DH_COMPUTE resulted in the inner HMAC being used without having been keyed, resulting in

Re: general protection fault in blkcipher_walk_done

2017-11-28 Thread Stephan Mueller
Am Dienstag, 28. November 2017, 08:53:07 CET schrieb Eric Biggers: Hi Eric, > On Mon, Nov 27, 2017 at 09:37:38PM -0800, Eric Biggers wrote: > > On Mon, Nov 27, 2017 at 10:56:47AM -0800, syzbot wrote: > > > Hello, > > > > > > syzkaller hit the following crash on > > >

Re: general protection fault in af_alg_free_areq_sgls

2017-11-28 Thread Eric Biggers
On Mon, Nov 27, 2017 at 10:56:47AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > b0a84f19a5161418d4360cd57603e94ed489915e > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console

[PATCH 0/4] crypto: inside-secure - set of fixes

2017-11-28 Thread Antoine Tenart
Hi Herbert, This series is a set of 4 fixes on the Inside Secure SafeXcel crypto engine driver. The series will be followed by another non-fix one. This is based on v4.15-rc1. Thanks, Antoine Antoine Tenart (3): crypto: inside-secure - free requests even if their handling failed crypto:

[PATCH 2/4] crypto: inside-secure - free requests even if their handling failed

2017-11-28 Thread Antoine Tenart
This patch frees the request private data even if its handling failed, as it would never be freed otherwise. Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver") Suggested-by: Ofer Heifetz Signed-off-by: Antoine Tenart

[PATCH 4/4] crypto: inside-secure - fix request allocations in invalidation path

2017-11-28 Thread Antoine Tenart
This patch makes use of the SKCIPHER_REQUEST_ON_STACK and AHASH_REQUEST_ON_STACK helpers to allocate enough memory to contain both the crypto request structures and their embedded context (__ctx). Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver")

[PATCH 3/4] crypto: inside-secure - only update the result buffer when provided

2017-11-28 Thread Antoine Tenart
The patch fixes the ahash support by only updating the result buffer when provided. Otherwise the driver could crash with NULL pointer exceptions, because the ahash caller isn't required to supply a result buffer on all calls. Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197

[PATCH 1/4] crypto: inside-secure - per request invalidation

2017-11-28 Thread Antoine Tenart
From: Ofer Heifetz When an invalidation request is needed we currently override the context .send and .handle_result helpers. This is wrong as under high load other requests can already be queued and overriding the context helpers will make them execute the wrong .send and

Re: general protection fault in af_alg_free_areq_sgls

2017-11-28 Thread Stephan Mueller
Am Dienstag, 28. November 2017, 10:02:52 CET schrieb Eric Biggers: Hi Eric, > --- > crypto/af_alg.c | 13 +++-- > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/crypto/af_alg.c b/crypto/af_alg.c > index 358749c38894..415a54ced4d6 100644 > --- a/crypto/af_alg.c > +++

Re: [PATCH 1/4] crypto: inside-secure - per request invalidation

2017-11-28 Thread Antoine Tenart
On Tue, Nov 28, 2017 at 10:05:15AM +0100, Antoine Tenart wrote: > From: Ofer Heifetz > > When an invalidation request is needed we currently override the context > .send and .handle_result helpers. This is wrong as under high load other > requests can already be queued and

Re: [PATCH 2/8] fs: pstore: remove unused hardirq.h

2017-11-28 Thread Kees Cook
On Fri, Nov 17, 2017 at 3:02 PM, Yang Shi wrote: > Preempt counter APIs have been split out, currently, hardirq.h just > includes irq_enter/exit APIs which are not used by pstore at all. > > So, remove the unused hardirq.h. > > Signed-off-by: Yang Shi