Received: by 10.192.165.148 with SMTP id m20csp338740imm; Wed, 2 May 2018 00:51:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqpJmLzjFB4GP/veyRK9hBWIjPiXyAILkHsQa8Pp6XwvQ1R0zQrnnEtsq/8VBomoc1L9wU7 X-Received: by 2002:a17:902:2a43:: with SMTP id i61-v6mr19476519plb.54.1525247500099; Wed, 02 May 2018 00:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525247500; cv=none; d=google.com; s=arc-20160816; b=iE53j+OS3h2XEKwMGI4O2WbPEXO3sIllgLIkCut+8D4jzAN7f1Lo3tnhX0+Fsj2ajq 95jQMPN6toqI9+F9/WafS7v1ilJ+9ZA8ETpUN07qp6LKTVOCWpQJnFxQoJyj7f8Xu3Yl mZZx/8hBhq+/NHU7hfVuh5r62VybgA1W0fO0w8F2ZEgENLONeeHKEArE7c/77xOBP0pZ PujYCa0BP4xqXcAqrFtyIXQBI7xIRfhY85lMjgxWLU++W+X+qYO1bJdN/K8LN2x0xsy+ 8mGgBqhMWxwMUjvuKE12N6Sxq9/iJ52NdOxRr2psTxCb9noihoCIedIlPH4ROatYy6A3 bGlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ZweXpq+vSw41jboRFRtRpq7qHkGeJUcg9jYZAFbyCIg=; b=I57rSROpgDghfSSfGuoZvh9rlt2kOsy++F2rSXcnqqNcYPwrmmOox431nul01G6kpM vlv596v1tABDRIaY0FuYbxvNNjlf4s2OMZIw113+Fsnun+nZK1njC2wtL6AWM0Z/hgI5 zdJ4KWJLct+iM0TkYH8hNGHLOJV+yXPs9VQTJ05U2Mal/l/ecIBJGtNfhm7qaEsoeJBB CZG5vYbMjkVOGLYpqKig5Gt+u5ChLSyVg9zJbInRefwsHprhpl+qblFEEeo+q0T+ThOX kPvMvJf6zXla3GnbjdUWXvwpqpJ+Zcc8Q5qfTp0+L+DOf7dduzLg4Llt5i4vfZxQtsm6 mWfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=JmxzKos0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si11515790pfm.220.2018.05.02.00.51.25; Wed, 02 May 2018 00:51:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=JmxzKos0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751095AbeEBHvO (ORCPT + 99 others); Wed, 2 May 2018 03:51:14 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33853 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007AbeEBHvM (ORCPT ); Wed, 2 May 2018 03:51:12 -0400 Received: by mail-wm0-f67.google.com with SMTP id a137so16316136wme.1 for ; Wed, 02 May 2018 00:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=ZweXpq+vSw41jboRFRtRpq7qHkGeJUcg9jYZAFbyCIg=; b=JmxzKos0+kHiXr3R225gMRO9pBlPzGnjQIaBjjmH2Ujp2aypjn4sGfmQUix1UlpZJS xjT2Stkn+lMl31RSHsSQOk2uQaxV50nMjDjXEJDsMPZxj7l+G/FkBGZ28o86FzmmHiE+ pLjiU0XS1Fk6YzKpDeuhz4OI7I+qTSS1E5UbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZweXpq+vSw41jboRFRtRpq7qHkGeJUcg9jYZAFbyCIg=; b=l6ZDKUiom3TyLE0tJ/0vbuQrfgKHLjiTveL69fOKCW+7AWq/VqjNhmh4NOqBGEzys5 7Hv+X7m/oLGaJYxvAd+F8sYbZpKlobMeL0xg9xehzUYOiX7pbOrn+1HCH10TdJu2VNl/ OuyOoV1BHzCLFby6VRxi/cBHlL6kt1UqQp6yZcmStfIZ/U/VrlnFKrU/7fnbkm8WJjlN 9sZ2iF3UcxTtfV1+g6mHwa21pgeRSW8RjiuooIJlOqumLz6PGmQtI2z+VOn/P7RSLfea RKhFD+PSGdp1G0R/yBtOAaOqejb6dHXSmWiL5m6Nhi4LJmlV6ryCd+FjBeXaEl9IdhYN L/PQ== X-Gm-Message-State: ALQs6tDGl4uuSJ5nk5YE6ALtdBh8gPjc6MhJf3BXuUxWlPRJXUqJ4Nhi dwkAcrkHOj72Mhs3B2XsIMSMnC96 X-Received: by 2002:a50:949c:: with SMTP id s28-v6mr24664159eda.201.1525247471238; Wed, 02 May 2018 00:51:11 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id v23-v6sm6353224edr.48.2018.05.02.00.51.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 00:51:10 -0700 (PDT) From: Daniel Vetter To: LKML Cc: DRI Development , Daniel Vetter , Eric Anholt , linux-doc@vger.kernel.org, Jonathan Corbet , Daniel Vetter Subject: [PATCH] doc: botching-up-ioctls: Make it clearer why structs must be padded Date: Wed, 2 May 2018 09:51:06 +0200 Message-Id: <20180502075106.7476-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This came up in discussions when reviewing drm patches. Cc: Eric Anholt Cc: linux-doc@vger.kernel.org Cc: Jonathan Corbet Signed-off-by: Daniel Vetter -- 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. * Have simple testcases for all of the above. -- 2.17.0