Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1656343 > unrolled thread

Re: [PATCH 1/5] KEYS: sanitize add_key() and keyctl() key payloads

Started byDavid Howells <dhowells@redhat.com>
First post2017-06-02 17:40 +0200
Last post2017-06-02 19:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/5] KEYS: sanitize add_key() and keyctl() key payloads David Howells <dhowells@redhat.com> - 2017-06-02 17:40 +0200
    Re: [PATCH 1/5] KEYS: sanitize add_key() and keyctl() key payloads Eric Biggers <ebiggers3@gmail.com> - 2017-06-02 19:30 +0200

#1656343 — Re: [PATCH 1/5] KEYS: sanitize add_key() and keyctl() key payloads

FromDavid Howells <dhowells@redhat.com>
Date2017-06-02 17:40 +0200
SubjectRe: [PATCH 1/5] KEYS: sanitize add_key() and keyctl() key payloads
Message-ID<tNWQ9-314-9@gated-at.bofh.it>
Eric Biggers <ebiggers3@gmail.com> wrote:

>  error2:
> +	memzero_explicit(payload, plen);

Isn't that wrong?  payload can be NULL.

David

[toc] | [next] | [standalone]


#1656403

FromEric Biggers <ebiggers3@gmail.com>
Date2017-06-02 19:30 +0200
Message-ID<tNYyC-49F-7@gated-at.bofh.it>
In reply to#1656343
On Fri, Jun 02, 2017 at 04:34:44PM +0100, David Howells wrote:
> Eric Biggers <ebiggers3@gmail.com> wrote:
> 
> >  error2:
> > +	memzero_explicit(payload, plen);
> 
> Isn't that wrong?  payload can be NULL.
> 
> David

If you're talking about memset(NULL, ..., 0) being undefined behavior, it's
completely insane but sure, I guess we should add the NULL check to be safe.  It
would also mean there would be no requirement that "KEYS: fix dereferencing NULL
payload with nonzero length" be applied first so the second paragraph of the
commit message would be removed.  I'll send a v2 of just this patch.

Eric

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web