lkml.org 
[lkml]   [2021]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] crypto: xts_crypt() return if walk.nbytes is 0
On Fri, 20 Aug 2021 at 14:53, Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Fri, Aug 20, 2021 at 01:14:52PM +0200, Ard Biesheuvel wrote:
> >
> > In spite of that, I have a slight preference for this version, given
> > that it makes it obvious that we bail on two separate conditions:
> > - an error has occurred
> > - no error has occurred but the resulting walk is empty
> >
> > Testing walk.nbytes only needlessly obfuscates the code, as we need to
> > return 'err' in the end anyway.
>
> I disagree, this is how most skcipher walkers are structured, they
> never explicitly test on err and only terminate the loop when
> walk->nbytes hits zero, in which case err is returned as is.
>
> I don't see why this particular skcipher walker should deviate
> from that paradigm. In fact it is exactly that deviation that
> caused the bug in the first instance.
>

Fair enough.

\
 
 \ /
  Last update: 2021-08-22 15:24    [W:2.206 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site