* [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip() @ 2009-12-07 13:28 Roel Kluin 2009-12-07 13:40 ` Sebastian Andrzej Siewior 0 siblings, 1 reply; 9+ messages in thread From: Roel Kluin @ 2009-12-07 13:28 UTC (permalink / raw) To: Herbert Xu, David S. Miller, linux-crypto, Andrew Morton, LKML Return the PTR_ERR of the correct pointer. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> --- drivers/crypto/geode-aes.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 4801162..12cf864 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c @@ -263,7 +263,7 @@ static int fallback_init_cip(struct crypto_tfm *tfm) if (IS_ERR(op->fallback.cip)) { printk(KERN_ERR "Error allocating fallback algo %s\n", name); - return PTR_ERR(op->fallback.blk); + return PTR_ERR(op->fallback.cip); } return 0; ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip() 2009-12-07 13:28 [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip() Roel Kluin @ 2009-12-07 13:40 ` Sebastian Andrzej Siewior 2009-12-07 14:14 ` Roel Kluin 0 siblings, 1 reply; 9+ messages in thread From: Sebastian Andrzej Siewior @ 2009-12-07 13:40 UTC (permalink / raw) To: Roel Kluin Cc: Herbert Xu, David S. Miller, linux-crypto, Andrew Morton, LKML, Sergey Mironov * Roel Kluin | 2009-12-07 14:28:23 [+0100]: >Return the PTR_ERR of the correct pointer. > >Signed-off-by: Roel Kluin <roel.kluin@gmail.com> >--- > drivers/crypto/geode-aes.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > >diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c >index 4801162..12cf864 100644 >--- a/drivers/crypto/geode-aes.c >+++ b/drivers/crypto/geode-aes.c >@@ -263,7 +263,7 @@ static int fallback_init_cip(struct crypto_tfm *tfm) > > if (IS_ERR(op->fallback.cip)) { > printk(KERN_ERR "Error allocating fallback algo %s\n", name); >- return PTR_ERR(op->fallback.blk); >+ return PTR_ERR(op->fallback.cip); > } This is correct however you missed one spot a few lines above that one. Sergey Mironov sent a patch a while ago unfortunatelly a mangled one and he hasn't resent it yet. Could you please look at [0] for the missing spot? If you had fun fixing that one, I've a made a similar mistake in s390's driver [1]. If not please say so. > > return 0; [0] http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg03883.html [1] http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg03888.html Sebastian ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip() 2009-12-07 13:40 ` Sebastian Andrzej Siewior @ 2009-12-07 14:14 ` Roel Kluin 2009-12-11 15:03 ` Herbert Xu 0 siblings, 1 reply; 9+ messages in thread From: Roel Kluin @ 2009-12-07 14:14 UTC (permalink / raw) To: Sebastian Andrzej Siewior Cc: Herbert Xu, David S. Miller, linux-crypto, Andrew Morton, LKML, Sergey Mironov Return the PTR_ERR of the correct pointer. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> --- > This is correct however you missed one spot a few lines above that one. > Sergey Mironov sent a patch a while ago unfortunatelly a mangled one and > he hasn't resent it yet. > Could you please look at [0] for the missing spot? If you had fun fixing > that one, I've a made a similar mistake in s390's driver [1]. If not > please say so. Yes, I found that one too, although I sent a patch in a seperate thread. You can ignore that and ack this if you like it. I did not find the additional mistakes, though, so a new patch below. > [0] http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg03883.html > [1] http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg03888.html > > Sebastian Thanks, Roel arch/s390/crypto/aes_s390.c | 8 ++++---- drivers/crypto/geode-aes.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index 6118890..58f4673 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c @@ -78,14 +78,14 @@ static int setkey_fallback_cip(struct crypto_tfm *tfm, const u8 *in_key, struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); int ret; - sctx->fallback.blk->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; - sctx->fallback.blk->base.crt_flags |= (tfm->crt_flags & + sctx->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; + sctx->fallback.cip->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK); ret = crypto_cipher_setkey(sctx->fallback.cip, in_key, key_len); if (ret) { tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; - tfm->crt_flags |= (sctx->fallback.blk->base.crt_flags & + tfm->crt_flags |= (sctx->fallback.cip->base.crt_flags & CRYPTO_TFM_RES_MASK); } return ret; @@ -174,7 +174,7 @@ static int fallback_init_cip(struct crypto_tfm *tfm) if (IS_ERR(sctx->fallback.cip)) { pr_err("Allocating AES fallback algorithm %s failed\n", name); - return PTR_ERR(sctx->fallback.blk); + return PTR_ERR(sctx->fallback.cip); } return 0; diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 4801162..03e71b1 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c @@ -135,8 +135,8 @@ static int geode_setkey_cip(struct crypto_tfm *tfm, const u8 *key, /* * The requested key size is not supported by HW, do a fallback */ - op->fallback.blk->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; - op->fallback.blk->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK); + op->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; + op->fallback.cip->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK); ret = crypto_cipher_setkey(op->fallback.cip, key, len); if (ret) { @@ -263,7 +263,7 @@ static int fallback_init_cip(struct crypto_tfm *tfm) if (IS_ERR(op->fallback.cip)) { printk(KERN_ERR "Error allocating fallback algo %s\n", name); - return PTR_ERR(op->fallback.blk); + return PTR_ERR(op->fallback.cip); } return 0; ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip() 2009-12-07 14:14 ` Roel Kluin @ 2009-12-11 15:03 ` Herbert Xu 2010-01-06 18:07 ` Sebastian Andrzej Siewior 0 siblings, 1 reply; 9+ messages in thread From: Herbert Xu @ 2009-12-11 15:03 UTC (permalink / raw) To: Roel Kluin Cc: Sebastian Andrzej Siewior, David S. Miller, linux-crypto, Andrew Morton, LKML, Sergey Mironov On Mon, Dec 07, 2009 at 03:14:33PM +0100, Roel Kluin wrote: > Return the PTR_ERR of the correct pointer. > > Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Patch applied. Thank you. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip() 2009-12-11 15:03 ` Herbert Xu @ 2010-01-06 18:07 ` Sebastian Andrzej Siewior 2010-01-07 0:50 ` Herbert Xu 0 siblings, 1 reply; 9+ messages in thread From: Sebastian Andrzej Siewior @ 2010-01-06 18:07 UTC (permalink / raw) To: Herbert Xu Cc: Roel Kluin, David S. Miller, linux-crypto, Andrew Morton, LKML, Sergey Mironov, Martin Schwidefsky * Herbert Xu | 2009-12-11 23:03:49 [+0800]: >On Mon, Dec 07, 2009 at 03:14:33PM +0100, Roel Kluin wrote: >> Return the PTR_ERR of the correct pointer. >> >> Signed-off-by: Roel Kluin <roel.kluin@gmail.com> > >Patch applied. Thank you. Martin picked an earlier version of this patch [0] which is allready in Linus' tree as b59cdcb33 ("[S390] crypto: use more descriptive function names for init/exit routines.") and I don't see this in the cryptodev or crypto tree. Herbert, do you want me to rebase this patch on top of Linus' tree or do you have allready plans for this? [0] http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg03919.html Sebastian ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip() 2010-01-06 18:07 ` Sebastian Andrzej Siewior @ 2010-01-07 0:50 ` Herbert Xu 2010-01-07 21:16 ` [PATCH 1/2] crypto/s390_aes: access .cip instead of .blk in cipher mode Sebastian Andrzej Siewior 2010-01-07 21:17 ` [PATCH 2/2] crypto/geode_aes: " Sebastian Andrzej Siewior 0 siblings, 2 replies; 9+ messages in thread From: Herbert Xu @ 2010-01-07 0:50 UTC (permalink / raw) To: Sebastian Andrzej Siewior Cc: Roel Kluin, David S. Miller, linux-crypto, Andrew Morton, LKML, Sergey Mironov, Martin Schwidefsky On Wed, Jan 06, 2010 at 07:07:36PM +0100, Sebastian Andrzej Siewior wrote: > > Herbert, do you want me to rebase this patch on top of Linus' tree or > do you have allready plans for this? > > [0] http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg03919.html Plesae repost. Thanks! -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] crypto/s390_aes: access .cip instead of .blk in cipher mode 2010-01-07 0:50 ` Herbert Xu @ 2010-01-07 21:16 ` Sebastian Andrzej Siewior 2010-01-07 21:17 ` [PATCH 2/2] crypto/geode_aes: " Sebastian Andrzej Siewior 1 sibling, 0 replies; 9+ messages in thread From: Sebastian Andrzej Siewior @ 2010-01-07 21:16 UTC (permalink / raw) To: Herbert Xu Cc: Sebastian Andrzej Siewior, Roel Kluin, David S. Miller, linux-crypto, Andrew Morton, LKML, Sergey Mironov, Martin Schwidefsky >From aff6860829e06f8f7ba5f4a8160a6612e1a6eca7 Mon Sep 17 00:00:00 2001 From: Roel Kluin <roel.kluin@gmail.com> Date: Thu, 7 Jan 2010 21:55:50 +0100 The fallback code in cipher mode touch the union fallback.blk instead of fallback.cip. This is wrong because we use the cipher and not the blockcipher. This did not show any side effects yet because both types / structs contain the same element right now. [bigeasy@breakpoint: different commit message, split the patch in two and rebase ] Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> --- arch/s390/crypto/aes_s390.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index 6be4503..58f4673 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c @@ -78,14 +78,14 @@ static int setkey_fallback_cip(struct crypto_tfm *tfm, const u8 *in_key, struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm); int ret; - sctx->fallback.blk->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; - sctx->fallback.blk->base.crt_flags |= (tfm->crt_flags & + sctx->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; + sctx->fallback.cip->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK); ret = crypto_cipher_setkey(sctx->fallback.cip, in_key, key_len); if (ret) { tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; - tfm->crt_flags |= (sctx->fallback.blk->base.crt_flags & + tfm->crt_flags |= (sctx->fallback.cip->base.crt_flags & CRYPTO_TFM_RES_MASK); } return ret; -- 1.6.6 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] crypto/geode_aes: access .cip instead of .blk in cipher mode 2010-01-07 0:50 ` Herbert Xu 2010-01-07 21:16 ` [PATCH 1/2] crypto/s390_aes: access .cip instead of .blk in cipher mode Sebastian Andrzej Siewior @ 2010-01-07 21:17 ` Sebastian Andrzej Siewior 2010-01-08 3:19 ` Herbert Xu 1 sibling, 1 reply; 9+ messages in thread From: Sebastian Andrzej Siewior @ 2010-01-07 21:17 UTC (permalink / raw) To: Herbert Xu Cc: Sebastian Andrzej Siewior, Roel Kluin, David S. Miller, linux-crypto, Andrew Morton, LKML, Sergey Mironov, Martin Schwidefsky >From caa5c9a662be92aa79b2ef1d14a509391cfa9254 Mon Sep 17 00:00:00 2001 From: Roel Kluin <roel.kluin@gmail.com> Date: Thu, 7 Jan 2010 22:00:26 +0100 The fallback code in cipher mode touch the union fallback.blk instead of fallback.cip. This is wrong because we use the cipher and not the blockcipher. This did not show any side effects yet because both types / structs contain the same element right now. [bigeasy@breakpoint: different commit message, split the patch in two] Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> --- drivers/crypto/geode-aes.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 4801162..03e71b1 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c @@ -135,8 +135,8 @@ static int geode_setkey_cip(struct crypto_tfm *tfm, const u8 *key, /* * The requested key size is not supported by HW, do a fallback */ - op->fallback.blk->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; - op->fallback.blk->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK); + op->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; + op->fallback.cip->base.crt_flags |= (tfm->crt_flags & CRYPTO_TFM_REQ_MASK); ret = crypto_cipher_setkey(op->fallback.cip, key, len); if (ret) { @@ -263,7 +263,7 @@ static int fallback_init_cip(struct crypto_tfm *tfm) if (IS_ERR(op->fallback.cip)) { printk(KERN_ERR "Error allocating fallback algo %s\n", name); - return PTR_ERR(op->fallback.blk); + return PTR_ERR(op->fallback.cip); } return 0; -- 1.6.6 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] crypto/geode_aes: access .cip instead of .blk in cipher mode 2010-01-07 21:17 ` [PATCH 2/2] crypto/geode_aes: " Sebastian Andrzej Siewior @ 2010-01-08 3:19 ` Herbert Xu 0 siblings, 0 replies; 9+ messages in thread From: Herbert Xu @ 2010-01-08 3:19 UTC (permalink / raw) To: Sebastian Andrzej Siewior Cc: Roel Kluin, David S. Miller, linux-crypto, Andrew Morton, LKML, Sergey Mironov, Martin Schwidefsky On Thu, Jan 07, 2010 at 10:17:02PM +0100, Sebastian Andrzej Siewior wrote: > >From caa5c9a662be92aa79b2ef1d14a509391cfa9254 Mon Sep 17 00:00:00 2001 > From: Roel Kluin <roel.kluin@gmail.com> > Date: Thu, 7 Jan 2010 22:00:26 +0100 > > The fallback code in cipher mode touch the union fallback.blk instead > of fallback.cip. This is wrong because we use the cipher and not the > blockcipher. This did not show any side effects yet because both types / > structs contain the same element right now. > > [bigeasy@breakpoint: different commit message, split the patch in two] > > Signed-off-by: Roel Kluin <roel.kluin@gmail.com> > Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> All applied. Thanks! -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-01-08 3:19 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-12-07 13:28 [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip() Roel Kluin 2009-12-07 13:40 ` Sebastian Andrzej Siewior 2009-12-07 14:14 ` Roel Kluin 2009-12-11 15:03 ` Herbert Xu 2010-01-06 18:07 ` Sebastian Andrzej Siewior 2010-01-07 0:50 ` Herbert Xu 2010-01-07 21:16 ` [PATCH 1/2] crypto/s390_aes: access .cip instead of .blk in cipher mode Sebastian Andrzej Siewior 2010-01-07 21:17 ` [PATCH 2/2] crypto/geode_aes: " Sebastian Andrzej Siewior 2010-01-08 3:19 ` Herbert Xu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox