public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	LKML <linux-kernel@vger.kernel.org>
Cc: DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] doc: botching-up-ioctls: Make it clearer why structs must be padded
Date: Wed, 02 May 2018 09:56:58 -0700	[thread overview]
Message-ID: <87muxi5739.fsf@anholt.net> (raw)
In-Reply-To: <20180502075106.7476-1-daniel.vetter@ffwll.ch>

[-- Attachment #1: Type: text/plain, Size: 1538 bytes --]

Daniel Vetter <daniel.vetter@ffwll.ch> writes:

> This came up in discussions when reviewing drm patches.
>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: linux-doc@vger.kernel.org
> Cc: Jonathan Corbet <corbet@lwn.net>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> --
>
> Aside: I wonder whether we shouldn't move this to some other place and
> rst-ify it? Any good suggestions?
> -Daniel
> ---
>  Documentation/ioctl/botching-up-ioctls.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/ioctl/botching-up-ioctls.txt b/Documentation/ioctl/botching-up-ioctls.txt
> index d02cfb48901c..883fb034bd04 100644
> --- a/Documentation/ioctl/botching-up-ioctls.txt
> +++ b/Documentation/ioctl/botching-up-ioctls.txt
> @@ -73,7 +73,9 @@ will have a second iteration or at least an extension for any given interface.
>     future extensions is going right down the gutters since someone will submit
>     an ioctl struct with random stack garbage in the yet unused parts. Which
>     then bakes in the ABI that those fields can never be used for anything else
> -   but garbage.
> +   but garbage. This is also the reason why you must explicitly pad all
> +   structures, even if you never use them in an array - the padding the compiler
> +   might insert could contain garbage.

I hadn't realized that we had this document in git, or I probably would
have written this patch.  I think this makes it clear enough how I got
vc4 and v3d wrong.  Thanks!

Reviewed-by: Eric Anholt <eric@anholt.net>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-05-02 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02  7:51 [PATCH] doc: botching-up-ioctls: Make it clearer why structs must be padded Daniel Vetter
2018-05-02 16:56 ` Eric Anholt [this message]
2018-05-08 14:53 ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87muxi5739.fsf@anholt.net \
    --to=eric@anholt.net \
    --cc=corbet@lwn.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox