|
|
Message-ID: <CAHmME9oXiTmVuOYmG=K3ijWK+zP2yB9a2CFjbLx_5fkDiH30Tg@mail.gmail.com>
Date: Mon, 11 May 2020 15:41:27 -0600
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Eric Biggers <ebiggers@...nel.org>
Cc: David Howells <dhowells@...hat.com>, keyrings@...r.kernel.org,
Andy Lutomirski <luto@...nel.org>, Greg KH <gregkh@...uxfoundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>, kernel-hardening@...ts.openwall.com
Subject: Re: [PATCH v2] security/keys: rewrite big_key crypto to use Zinc
On Sun, May 10, 2020 at 3:17 PM Eric Biggers <ebiggers@...nel.org> wrote:
> The commit message should say "lib/crypto", not Zinc. Nothing in the source
> tree actually says Zinc, so it will confuse people who haven't read all the
> previous discussions.
Old commit message from a few years ago. Will adjust.
>
> > /* read file to kernel and decrypt */
> > - ret = kernel_read(file, buf->virt, enclen, &pos);
> > + ret = kernel_read(file, buf, enclen, &pos);
> > if (ret >= 0 && ret != enclen) {
> > ret = -EIO;
> > goto err_fput;
> > + } else if (ret < 0) {
> > + goto err_fput;
> > }
>
> It would make sense to write this as the following, to make it consistent with
> how the return value of kernel_write() is checked in big_key_preparse():
>
> ret = kernel_read(file, buf, enclen, &pos);
> if (ret != enclen) {
> if (ret >= 0)
> ret = -ENOMEM;
> goto err_fput;
> }
Will do, and will send a v3 with your reviewed-by.
Jason
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.