All of lore.kernel.org
 help / color / mirror / Atom feed
* Possible bug: blkcipher_walk_done()
@ 2010-02-10  9:42 Dmitry Kasatkin
  2010-02-14  5:47 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Kasatkin @ 2010-02-10  9:42 UTC (permalink / raw)
  To: linux-crypto

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?

- Dmitry


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Possible bug: blkcipher_walk_done()
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2010-02-14  5:47 UTC (permalink / raw)
  To: Dmitry Kasatkin; +Cc: linux-crypto

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,
-- 
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] 3+ messages in thread

* Re: Possible bug: blkcipher_walk_done()
  2010-02-14  5:47 ` Herbert Xu
@ 2010-02-15 19:02   ` Dmitry Kasatkin
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Kasatkin @ 2010-02-15 19:02 UTC (permalink / raw)
  To: ext Herbert Xu; +Cc: linux-crypto

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,
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-15 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.