lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Sep 2012 13:22:13 +0300
From:	"Kasatkin, Dmitry" <dmitry.kasatkin@...el.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	James Morris <jmorris@...ei.org>,
	linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [GIT] Digital signature library bugfix

On Wed, Sep 12, 2012 at 8:38 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Wed, Sep 12, 2012 at 11:34 AM, James Morris <jmorris@...ei.org> wrote:
>>
>> -       if (!err && len == hlen)
>> -               err = memcmp(out2, h, hlen);
>> +       if (err || len != hlen) {
>> +               err = -EINVAL;
>> +               goto err;
>> +       }
>> +
>> +       err = memcmp(out2, h, hlen);
>>
>>  err:
>
> Hmm. I'll pull, but this seems to drop the error return from
> pkcs_1_v1_5_decode_emsa() and always replace it with -EINVAL.
>
> Now, I didn't look, and maybe that's the only error that the decode
> thing can return, but still, it looks bad.
>
> Wouldn't it have been better to do instead
>
>    if (err)
>       goto err;
>    err = -EINVAL;
>    if (len != hlen)
>       goto err;
>
> and not overwrite the 'err' return with EINVAL?
>

Error code here just means success or failure.
I did not like it either, but that was just to fix a bug (cc:stable)
and I have one patch more to refactor that stuff for mainline kernel.

But I will re-send updated patch in a moment.

Thanks.

>              Linus
> --
> To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ