From: Daniel Vetter Date: Wed, 2 May 2018 07:51:06 +0000 (+0200) Subject: doc: botching-up-ioctls: Make it clearer why structs must be padded X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1897e8f394c50124f90d6c1be672f05846438bf8;p=linux.git doc: botching-up-ioctls: Make it clearer why structs must be padded This came up in discussions when reviewing drm patches. Reviewed-by: Eric Anholt Signed-off-by: Daniel Vetter Signed-off-by: Jonathan Corbet --- diff --git a/Documentation/ioctl/botching-up-ioctls.txt b/Documentation/ioctl/botching-up-ioctls.txt index d02cfb48901c5..883fb034bd04a 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. * Have simple testcases for all of the above.