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


Groups > linux.kernel > #1637760

Re: [PATCH] key: Convert big_key payload.data to struct

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] key: Convert big_key payload.data to struct
Date 2017-05-09 00:10 +0200
Message-ID <tEZ0S-1js-11@gated-at.bofh.it> (permalink)
References <tEYHw-Wn-19@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


Kees Cook <keescook@chromium.org> wrote:

> There is a lot of needless casting happening in the big_key data payload.
> This is harder to trivially verify by static analysis and specifically
> the randstruct GCC plugin (which was unhappy about casting a struct
> path across two entries of a void * array). This converts the payload to
> the actually used structures (one pointer, one embedded struct, and one
> size_t).

I'd really rather not do this as this moves the definition of an individual
key type into the general structure (I know I've done this for the keyring
type, but that's a special part of the keyring code).  That's the start of the
slippery slope into moving all of them in there.

I'd rather you defined, say:

	struct big_key_payload {
		u8		*key_data;
		struct path	key_path;
		size_t		key_len;
	};

in big_key.c and cast &key->payload to it.

David

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] key: Convert big_key payload.data to struct Kees Cook <keescook@chromium.org> - 2017-05-08 23:50 +0200
  Re: [PATCH] key: Convert big_key payload.data to struct David Howells <dhowells@redhat.com> - 2017-05-09 00:10 +0200
    Re: [PATCH] key: Convert big_key payload.data to struct Kees Cook <keescook@chromium.org> - 2017-05-09 00:30 +0200
      Re: [PATCH] key: Convert big_key payload.data to struct David Howells <dhowells@redhat.com> - 2017-05-09 10:20 +0200
        Re: [PATCH] key: Convert big_key payload.data to struct Kees Cook <keescook@chromium.org> - 2017-05-09 18:20 +0200
    Re: [PATCH] key: Convert big_key payload.data to struct Eric Biggers <ebiggers3@gmail.com> - 2017-05-09 00:30 +0200
      Re: [PATCH] key: Convert big_key payload.data to struct David Howells <dhowells@redhat.com> - 2017-05-09 09:30 +0200
        Re: [PATCH] key: Convert big_key payload.data to struct Eric Biggers <ebiggers3@gmail.com> - 2017-05-09 23:50 +0200

csiph-web