瀏覽代碼

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 <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Daniel Vetter 7 年之前
父節點
當前提交
1897e8f394
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Documentation/ioctl/botching-up-ioctls.txt

+ 3 - 1
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.