[v2 PATCH] crc-t10dif: Fix potential crypto notify dead-lock

2020-06-04 Thread Herbert Xu
The crypto notify call occurs with a read mutex held so you must not do any substantial work directly. In particular, you cannot call crypto_alloc_* as they may trigger further notifications which may dead-lock in the presence of another writer. This patch fixes this by postponing the work into a

Re: [PATCH v2] crypto: DRBG - always try to free Jitter RNG instance

2020-06-04 Thread Stephan Mueller
Am Freitag, 5. Juni 2020, 08:16:46 CEST schrieb Eric Biggers: Hi Eric, > On Fri, Jun 05, 2020 at 07:58:15AM +0200, Stephan Mueller wrote: > > Am Freitag, 5. Juni 2020, 02:43:36 CEST schrieb Eric Biggers: > > > > Hi Eric, > > > > > On Thu, Jun 04, 2020 at 08:41:00AM +0200, Stephan Müller wrote:

Re: [PATCH] crc-t10dif: Fix potential crypto notify dead-lock

2020-06-04 Thread Herbert Xu
On Thu, Jun 04, 2020 at 10:40:49PM -0700, Eric Biggers wrote: > On Thu, Jun 04, 2020 at 04:33:24PM +1000, Herbert Xu wrote: > > +static void crc_t10dif_rehash(struct work_struct *work) > > +{ > > + struct crypto_shash *new, *old; > > + > > mutex_lock(&crc_t10dif_mutex); > > old = rcu_dere

Re: [PATCH net] esp: select CRYPTO_SEQIV

2020-06-04 Thread Herbert Xu
On Thu, Jun 04, 2020 at 10:09:10PM -0700, Eric Biggers wrote: > > There's also a case where "seqiv" is used without counter mode: > > net/xfrm/xfrm_algo.c: > > { > .name = "rfc7539esp(chacha20,poly1305)", So select CRYPTO_SEQIV if CRYPTO_CTR || CRYPTO_CHACHA20POLY1305 and if th

Re: [PATCH v2] crypto: DRBG - always try to free Jitter RNG instance

2020-06-04 Thread Eric Biggers
On Fri, Jun 05, 2020 at 07:58:15AM +0200, Stephan Mueller wrote: > Am Freitag, 5. Juni 2020, 02:43:36 CEST schrieb Eric Biggers: > > Hi Eric, > > > On Thu, Jun 04, 2020 at 08:41:00AM +0200, Stephan Müller wrote: > > > The Jitter RNG is unconditionally allocated as a seed source follwoing > > > th

Re: [PATCH v2] crypto: DRBG - always try to free Jitter RNG instance

2020-06-04 Thread Stephan Mueller
Am Freitag, 5. Juni 2020, 02:43:36 CEST schrieb Eric Biggers: Hi Eric, > On Thu, Jun 04, 2020 at 08:41:00AM +0200, Stephan Müller wrote: > > The Jitter RNG is unconditionally allocated as a seed source follwoing > > the patch 97f2650e5040. Thus, the instance must always be deallocated. > > > > R

Re: [PATCH] crc-t10dif: Fix potential crypto notify dead-lock

2020-06-04 Thread Eric Biggers
On Thu, Jun 04, 2020 at 04:33:24PM +1000, Herbert Xu wrote: > +static void crc_t10dif_rehash(struct work_struct *work) > +{ > + struct crypto_shash *new, *old; > + > mutex_lock(&crc_t10dif_mutex); > old = rcu_dereference_protected(crct10dif_tfm, >

Re: [PATCH net] esp: select CRYPTO_SEQIV

2020-06-04 Thread Eric Biggers
On Fri, Jun 05, 2020 at 10:29:56AM +1000, Herbert Xu wrote: > On Fri, Jun 05, 2020 at 10:28:58AM +1000, Herbert Xu wrote: > > > > Hmm, the selection list doesn't include CTR so just adding SEQIV > > per se makes no sense. I'm not certain that we really want to > > include every algorithm under the

Re: BUG: sleeping function called from invalid context in crypto_drop_spawn

2020-06-04 Thread Matthew Wilcox
On Thu, Jun 04, 2020 at 05:40:31PM -0700, Eric Biggers wrote: > +Cc linux-crypto. crypto_free_shash() is being called in atomic context; > perhaps that should be allowed? kfree() can be called in atomic context. Although vfree() cannot (which i personally hate ...) > On Thu, Jun 04, 2020 at 05:

Re: [PATCH v2] crypto: hisilicon - allow smaller reads in debugfs

2020-06-04 Thread Shukun Tan
Hi Dan, On 2020/6/2 21:54, Dan Carpenter wrote: > Originally this code rejected any read less than 256 bytes. There > is no need for this artificial limit. We should just use the normal > helper functions to read a string from the kernel. > > Signed-off-by: Dan Carpenter > --- > v2: Use simple

Re: [PATCH v2] crypto: DRBG - always try to free Jitter RNG instance

2020-06-04 Thread Eric Biggers
On Thu, Jun 04, 2020 at 08:41:00AM +0200, Stephan Müller wrote: > The Jitter RNG is unconditionally allocated as a seed source follwoing > the patch 97f2650e5040. Thus, the instance must always be deallocated. > > Reported-by: syzbot+2e635807decef724a...@syzkaller.appspotmail.com > Fixes: 97f2650e

Re: BUG: sleeping function called from invalid context in crypto_drop_spawn

2020-06-04 Thread Eric Biggers
+Cc linux-crypto. crypto_free_shash() is being called in atomic context; perhaps that should be allowed? kfree() can be called in atomic context. On Thu, Jun 04, 2020 at 05:33:19PM -0700, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:39884604 mptcp: fix NU

Re: [PATCH net] esp: select CRYPTO_SEQIV

2020-06-04 Thread Herbert Xu
On Fri, Jun 05, 2020 at 10:28:58AM +1000, Herbert Xu wrote: > > Hmm, the selection list doesn't include CTR so just adding SEQIV > per se makes no sense. I'm not certain that we really want to > include every algorithm under the sun. Steffen, what do you think? Or how about select CRYPT

Re: [PATCH net] esp: select CRYPTO_SEQIV

2020-06-04 Thread Herbert Xu
On Thu, Jun 04, 2020 at 12:23:22PM -0700, Eric Biggers wrote: > From: Eric Biggers > > Since CRYPTO_CTR no longer selects CRYPTO_SEQIV, it should be selected > by INET_ESP and INET6_ESP -- similar to CRYPTO_ECHAINIV. > > Fixes: f23efcbcc523 ("crypto: ctr - no longer needs CRYPTO_SEQIV") > Cc: Co

Re: [PATCH] crypto: algboss - don't wait during notifier callback

2020-06-04 Thread Eric Biggers
On Thu, Jun 04, 2020 at 11:52:53AM -0700, Eric Biggers wrote: > From: Eric Biggers > > When a crypto template needs to be instantiated, CRYPTO_MSG_ALG_REQUEST > is sent to crypto_chain. cryptomgr_schedule_probe() handles this by > starting a thread to instantiate the template, then waiting for t

[PATCH net] esp: select CRYPTO_SEQIV

2020-06-04 Thread Eric Biggers
From: Eric Biggers Since CRYPTO_CTR no longer selects CRYPTO_SEQIV, it should be selected by INET_ESP and INET6_ESP -- similar to CRYPTO_ECHAINIV. Fixes: f23efcbcc523 ("crypto: ctr - no longer needs CRYPTO_SEQIV") Cc: Corentin Labbe Cc: Greg Kroah-Hartman Cc: Herbert Xu Cc: Steffen Klassert

[PATCH] crypto: algboss - don't wait during notifier callback

2020-06-04 Thread Eric Biggers
From: Eric Biggers When a crypto template needs to be instantiated, CRYPTO_MSG_ALG_REQUEST is sent to crypto_chain. cryptomgr_schedule_probe() handles this by starting a thread to instantiate the template, then waiting for this thread to complete via crypto_larval::completion. This can deadlock

Re: [PATCH v3 2/3] crypto: CRYPTO_CTR no longer need CRYPTO_SEQIV

2020-06-04 Thread Eric Biggers
On Fri, Apr 24, 2020 at 01:40:46PM +, Corentin Labbe wrote: > As comment of the v2, Herbert said: "The SEQIV select from CTR is historical > and no longer necessary." > > So let's get rid of it. > > Signed-off-by: Corentin Labbe > --- > crypto/Kconfig | 1 - > 1 file changed, 1 deletion(-)

Re: [PATCH] crypto: hisilicon - Cap block size at 2^31

2020-06-04 Thread Zhou Wang
On 2020/6/4 15:37, Herbert Xu wrote: > The function hisi_acc_create_sg_pool may allocate a block of > memory of size PAGE_SIZE * 2^(MAX_ORDER - 1). This value may > exceed 2^31 on ia64, which would overflow the u32. > > This patch caps it at 2^31. > > Reported-by: kernel test robot > Fixes: d8a

Re: [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy

2020-06-04 Thread Zhou Wang
On 2020/6/4 14:50, Herbert Xu wrote: > On Thu, Jun 04, 2020 at 02:44:16PM +0800, Zhangfei Gao wrote: >> >> I think it is fine. >> 1. Currently the name size is 64, bigger enough. >> Simply grep in driver name, 64 should be enough. >> We can make it larger when there is a request. >> 2. it does not

Re: [PATCH 0/2] Introduce PCI_FIXUP_IOMMU

2020-06-04 Thread Zhangfei Gao
On 2020/6/2 上午1:41, Bjorn Helgaas wrote: On Thu, May 28, 2020 at 09:33:44AM +0200, Joerg Roedel wrote: On Wed, May 27, 2020 at 01:18:42PM -0500, Bjorn Helgaas wrote: Is this slowdown significant? We already iterate over every device when applying PCI_FIXUP_FINAL quirks, so if we used the ex

Re: [PATCH v2] crypto: cavium/nitrox - Fix 'nitrox_get_first_device()' when ndevlist is fully iterated

2020-06-04 Thread Herbert Xu
On Sat, May 30, 2020 at 03:35:37PM +0200, Christophe JAILLET wrote: > When a list is completely iterated with 'list_for_each_entry(x, ...)', x is > not NULL at the end. > > While at it, remove a useless initialization of the ndev variable. It > is overridden by 'list_for_each_entry'. > > Fixes: f

Re: [RESEND PATCHv3 0/7] crypto: omap: various fixes

2020-06-04 Thread Herbert Xu
On Wed, May 27, 2020 at 03:24:22PM +0300, Tero Kristo wrote: > Hi, > > Resent the whole series as-per request. Only patch changed compared to > v2 [1] is patch #3. Cache flushing logic has been fixed on it based on > comments. > > -Tero > > [1] https://patchwork.kernel.org/cover/11540265/ All

Re: [PATCH v2 1/1] crypto: caam - fix typos

2020-06-04 Thread Horia Geantă
On 6/4/2020 1:40 PM, Heinrich Schuchardt wrote: > Fix CAAM related typos. > > Signed-off-by: Heinrich Schuchardt Reviewed-by: Horia Geantă Thanks, Horia

[PATCH v2 1/1] crypto: caam - fix typos

2020-06-04 Thread Heinrich Schuchardt
Fix CAAM related typos. Signed-off-by: Heinrich Schuchardt --- v2: fix additional typos as indicated by Horia replaces https://lkml.org/lkml/2020/6/3/1129 --- drivers/crypto/caam/Kconfig | 2 +- drivers/crypto/caam/ctrl.c | 18 +- drivers/crypto/caam/desc.h |

Re: [PATCH 1/1] crypto: caam - fix typo

2020-06-04 Thread Horia Geantă
On 6/4/2020 5:41 AM, Heinrich Schuchardt wrote: > %s/suppying/supplying/ > This is good since it's not detected by the default kernel spellchecker. Would you be willing to append also the detected typos? CHECK: 'interrrupt' may be misspelled - perhaps 'interrupt'? #57: FILE: drivers/crypto/caam/

Re: [PATCH] crypto: ccp - Fix sparse warnings in sev-dev

2020-06-04 Thread Borislav Petkov
+ Tom. On Thu, Jun 04, 2020 at 06:09:41PM +1000, Herbert Xu wrote: > This patch fixes a bunch of sparse warnings in sev-dev where the > __user marking is incorrectly handled. > > Reported-by: kbuild test robot > Fixes: 7360e4b14350 ("crypto: ccp: Implement SEV_PEK_CERT_IMPORT...") > Fixes: e7990

[PATCH] crypto: ccp - Fix sparse warnings in sev-dev

2020-06-04 Thread Herbert Xu
This patch fixes a bunch of sparse warnings in sev-dev where the __user marking is incorrectly handled. Reported-by: kbuild test robot Fixes: 7360e4b14350 ("crypto: ccp: Implement SEV_PEK_CERT_IMPORT...") Fixes: e799035609e1 ("crypto: ccp: Implement SEV_PEK_CSR ioctl...") Fixes: 76a2b524a4b1 ("cr

[PATCH] crypto: hisilicon - Cap block size at 2^31

2020-06-04 Thread Herbert Xu
The function hisi_acc_create_sg_pool may allocate a block of memory of size PAGE_SIZE * 2^(MAX_ORDER - 1). This value may exceed 2^31 on ia64, which would overflow the u32. This patch caps it at 2^31. Reported-by: kernel test robot Fixes: d8ac7b85236b ("crypto: hisilicon - fix large sgl memory.