Received: by 10.192.165.148 with SMTP id m20csp861866imm; Wed, 2 May 2018 09:57:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqkic6LetwCiwIys5qUgrqPGwY+8grjSz8dkMHqwsK1UpptmhTthBB6vvZ83EVqZ7bDLohs X-Received: by 2002:a63:ba05:: with SMTP id k5-v6mr16634009pgf.39.1525280261878; Wed, 02 May 2018 09:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525280261; cv=none; d=google.com; s=arc-20160816; b=M/gfVSX/T6FE2fsSO4ZBZdP88Q8PKJxRX+0bmb6m1xH+0KnwpEFuMd2lRzXVVV5ICa hFtuUE3AKeJpTz3YHEHY7brp1ULuAoRnpLRQU0HTUqQbjoA43lKXgifIT1ZA4WqvwXx+ gxWMItiuuvO/GcqA8ZEUW7XxMByedPZqcU2r+MQ4QvvWvFfrtm9rJ3ve9Dl/WBywF5xK 97k9dspv34UroMrja0dhta6k+GBDzkIlDkN5J1cRLX1IClCGgBAbOqLGO4gqnAwcMUXP o2vUUPXoUcEW/D8Ac4/5uATliKJhIcz9jFRmdngXzOYxlE4R5DrhGvO2MNf6Gf6e3J05 260g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from :arc-authentication-results; bh=YtbIN5p5Y5Omj5RglmxV0vzjikJLr0pclvmNLppkR+g=; b=ScPhxknHykX/LzGUsigY8tpgzhnvEWK6tlyp4GUHvxaENeiL72N56IjP3YyPNQ2da3 +TgrJijBT3cpmX5ws21VKvB8UfAplckCKQiC88HE+7nAG3dA0YVKm6JACl/G7C9ZlTaS t1C6bibkNQmFNzF5ZDPmcFClmupexS7uttVCuocHbzccBiAcy74jyGPKrZBhTuHTVmwX /6fsiC/OCWzFJM2SOKQ0EMELfEiEQh+IcpFh9gEoHeKjTity1M3fJdeZ2rKcMVZQiMJj 7c30EMMcZrrxV8vxJGzxUZuw59QyIlaXardIJnVgH1ai3eMWuR3H9Nu7nDJY3m2eUo/b UqlQ== ARC-Authentication-Results: i=1; mx.google.com; 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 9-v6si11904394plb.415.2018.05.02.09.57.27; Wed, 02 May 2018 09:57:41 -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; 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 S1751900AbeEBQ5F (ORCPT + 99 others); Wed, 2 May 2018 12:57:05 -0400 Received: from anholt.net ([50.246.234.109]:56622 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751447AbeEBQ5C (ORCPT ); Wed, 2 May 2018 12:57:02 -0400 Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 9D3A110A0D3B; Wed, 2 May 2018 09:57:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DkOvjy8Cb23p; Wed, 2 May 2018 09:56:59 -0700 (PDT) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id A370810A1706; Wed, 2 May 2018 09:56:59 -0700 (PDT) Received: by eliezer.anholt.net (Postfix, from userid 1000) id 08C7B2FE2D86; Wed, 2 May 2018 09:56:59 -0700 (PDT) From: Eric Anholt To: Daniel Vetter , LKML Cc: DRI Development , Daniel Vetter , linux-doc@vger.kernel.org, Jonathan Corbet , Daniel Vetter Subject: Re: [PATCH] doc: botching-up-ioctls: Make it clearer why structs must be padded In-Reply-To: <20180502075106.7476-1-daniel.vetter@ffwll.ch> References: <20180502075106.7476-1-daniel.vetter@ffwll.ch> User-Agent: Notmuch/0.22.2+1~gb0bcfaa (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Wed, 02 May 2018 09:56:58 -0700 Message-ID: <87muxi5739.fsf@anholt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Daniel Vetter writes: > 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. 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlrp7doACgkQtdYpNtH8 nujSSw//Yt2YIcLrz/sjFI9bbJ78aNyWQZJ/pWTNm1Z/kWNQys6kcQQWmwaZ6Wak psSoKFQuXWVkDHyPPedXc582S/7DerPP5uJ4pfLMW29BknQq9BOP50fEm/eFMmNr OgmqfdwSsj+IO/BmwOYfGuoBvavPLxhoTm1fiUvskz7dVZtYVS2Bk3bCX/Ab7hY8 HbbGqeTdIGkbZo7qgmFrT90+NhlRXWf+kum57QvtAlmLrSy8zwb7Nja/VUW4Zubd cO6YZBqllWh7IWTatDkaQl4LREvmmhFYSGWXCkSkTfEgHm8/wejPd/cgjpRl3GW5 fqU943l14Y2Mq68LaVcPIfo6eRdK1snKPBVgrpyTF+Jil08SUvW6EP4Y06LIoKk5 zLUB6ypE+18MlRjETl+PAddBePQMHC80f4uGczVamJ9QKca5s33wSdg3Rq1ouIZs 8On0l98imqbO7klD6DaJ48EjgYyDN5HeRwIXJFtRbZB3gEUI2hydO/HhpimyyQ32 ZKEM9o9ccr+R5yP2EtVf54Iv/j9BEURueSLWm6ZHdnZcvZqmS5lEKJTUl/586Viw T66vcI0WmKBEwWQW9dQIT/9HeQj2ZIQ+3jaGx7gpIzmQv+384R30/Iv7AURNqdjg SNEF9mkui5ZcBk+7piDm9OF+9yOl8ilsHGHE/bTAdXr4nRlSEqM= =YAwr -----END PGP SIGNATURE----- --=-=-=--