Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
To: ext Herbert Xu <herbert@gondor.apana.org.au>
Cc: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Subject: Re: Possible bug: blkcipher_walk_done()
Date: Mon, 15 Feb 2010 21:02:35 +0200	[thread overview]
Message-ID: <4B799A4B.4040904@nokia.com> (raw)
In-Reply-To: <20100214054756.GA9688@gondor.apana.org.au>

Hi,

Strange what you say.... if err < 0 the page are never mapped...

Pages mapped before... and they are not unmapped and mapped again...
So they left mapped..
And yes... if HW fails then it need to break the function and unmap
previously mapped pages.

I will submit patches for review soon to this list.

Thanks for your discussion!

- Dmitry

ext Herbert Xu wrote:
> On Wed, Feb 10, 2010 at 09:42:13AM +0000, Dmitry Kasatkin wrote:
>   
>> Hi,
>>
>> It seems that there is a mistake in the implementation of
>>
>> int blkcipher_walk_done(struct blkcipher_desc *desc,
>>             struct blkcipher_walk *walk, int err)
>>
>> blkcipher_walk_virt() will call crypto_kmap() to map page.
>>
>> But in the case then err argument is < 0 and we cannot continue then
>> blkcipher_walk_done() will not
>> unmap the page.
>>
>> What do you think?
>>     
>
> Only blkcipher.c itself calls blkcipher_walk_done with err < 0.
> Algorithms are not supposed to do that as this interface is only
> for synchronous implementations.
>
> When blkcipher.c uses it with err < 0 the pages are never mapped.
>
> Do you need to be able to fail with a synchronous algorithm?
>
> Cheers,
>   

      reply	other threads:[~2010-02-15 19:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10  9:42 Possible bug: blkcipher_walk_done() Dmitry Kasatkin
2010-02-14  5:47 ` Herbert Xu
2010-02-15 19:02   ` Dmitry Kasatkin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B799A4B.4040904@nokia.com \
    --to=dmitry.kasatkin@nokia.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox