Received: by 10.223.185.116 with SMTP id b49csp2951336wrg; Mon, 5 Mar 2018 11:20:01 -0800 (PST) X-Google-Smtp-Source: AG47ELvCOPCcJFkm/aJ4mUQGRihpju+Th3nwPKPzz2SopH1b2rmb6VRRuWoENQwESBXZPjPt2P+7 X-Received: by 10.99.163.111 with SMTP id v47mr12876809pgn.80.1520277601703; Mon, 05 Mar 2018 11:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520277601; cv=none; d=google.com; s=arc-20160816; b=VMCZbeTOHkR87gSBwW0KjKkpsr7qZhTWf7eyL2eG6TlX7xQuFPG8FWJLthOffnqLCZ QUaksdg3JHCXVUttKgE+GzbpgSaktXJ/nwjXYJ2tKzp4/qfErn2boVjjL6eCVPZK8STr N2Wg5ZhH/gLEutj12wRhRJSWiG1GVh5Z1byKnNLTkYVGkWTFXydL7pS13ZEyzPu2jB+e E3lQ8u523SgJVmCq4OPrOLqJIrjxtMnVDyhCFb6T70e0Gpf81RyDYLcr+X5CWO4IFARg 8CmEE1K4uZVF2kZAudo3F/b7pYYaCbpdBopwqEhh1sqck+81ZYuMhdEZCS/mW5V1Cjw3 6B5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=g0mOUb/1TkeDlODQ3BwQSnWpEczEmXsSeF4xZG85ztU=; b=ekHiOJ/SbBS/LPEKy1dgYpa1D7rKJnWyEgcyRm7q9kY22pFyH1yq3fOlnbX5zrgG4b qSSGd6F8zkN7QlyZPzd0SZMLzWLRAi1m2aQ8DPtYiZpmUToXFyPbBR56yk2tWBE9fzqH dgr0c0Ov0EWVER5OAorLSATrqL5sVqLG4nd9VoK/J/Mll+7ajvBAoMUqaRBBOEufzZhG M6dvg4Y1gVAgCW/GZd+IhnNi64+WF3BOO5QzjjNobpjQ9YIhrWBXU4sEKChzV+8Ivd2m rgsuFmiFU1M2Zbl2iCTx4BYFBVIk1Gtozlpz2GuvQQNbTea/xfEGrj9NCdewB2Jxcv0g arxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=eCwMUBtX; dkim=fail header.i=@linux-foundation.org header.s=google header.b=eqR1clod; 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 v6-v6si10078281plk.577.2018.03.05.11.19.47; Mon, 05 Mar 2018 11:20:01 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=eCwMUBtX; dkim=fail header.i=@linux-foundation.org header.s=google header.b=eqR1clod; 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 S1752480AbeCETSy (ORCPT + 99 others); Mon, 5 Mar 2018 14:18:54 -0500 Received: from mail-io0-f181.google.com ([209.85.223.181]:36322 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751490AbeCETSw (ORCPT ); Mon, 5 Mar 2018 14:18:52 -0500 Received: by mail-io0-f181.google.com with SMTP id e30so19208585ioc.3; Mon, 05 Mar 2018 11:18:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=g0mOUb/1TkeDlODQ3BwQSnWpEczEmXsSeF4xZG85ztU=; b=eCwMUBtXW05R3xuhx53qQN7aBtN5zMaJmaQPt5TTo6jU/OtcVmKJZaLNBWQmyBWWM5 hbHFakj7Trzuw2tfPI/frG2omfVUctR/sNLOEXWnHNF0V2Ge2AXaHV7nIwDCE3m/+UBQ Lmw4M2mCKJMkriuveb9JaYf+DM94OEUuTYee7IujlTC5HyNINmLCeD7QQsQqfNQW5ncC 5udFP3faPGzr8e68yKQEUSnJ+gxEaGU+2f3WrCng8SFk2eUoyAvGRrybsRzk2XmtJ4F+ M9Va+iAe2fjPnSLOSBr9VxiuKdn4/jU8bfmeR+uXB3rNCa/f4gwCKX2qbaamDoex49jB c7xw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=g0mOUb/1TkeDlODQ3BwQSnWpEczEmXsSeF4xZG85ztU=; b=eqR1clodDlon8CiY/HuowTPDrLFW7chGvD0QZzqZXrn/LwzCcLx064/Fqan9yGnfdt MqxkaMvUI8WRIzAq4IHJWTj7isugdrj/9bMrs0FzB894RA3wacSopcCOsWMxNeBJYgz2 3R/vhLiSxmQbCyv5y9xX7e99sk5Rcn1DDZ5yw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=g0mOUb/1TkeDlODQ3BwQSnWpEczEmXsSeF4xZG85ztU=; b=rYMrh8XDSzdTcReFpZV4t55dL2tJnQZTvUza6Z2fp9tNFJQePhmdBcyeXulpz5oq/8 IQidVARhQiDl146UuuwbrO0lrxpOo7kAhs18hBvRGgQG4/NQmUGEDPj8Ziwv+dBdqOxQ FUJqk6hUte3I+pQYcDf/Le4C5jjTfGQVjWdKs0Rw1Tk2KEAPH78gBll/2o+olZQcSK+v 8HZGqUyHZcT8++sKUN4+yk9d0hwE6uWaPiGC4wsSorkhyMkJ8t3uv8ZiyMpJWggyf+BQ 9utToO2PsG9DFvXpLWYwI0cZ8uzQpTavpnIOqb5hoygT9aBEXKmcjW4D2140aF2TDLh/ wKNg== X-Gm-Message-State: APf1xPBhG1e7WHzxqX+B9Prh0kxSXJyVlP96MpKkrP+Qt1wgA1TcJK0z vtwpRLYuF+OtpaFk6jHGxlpnGDmemjiQ/dBf4cE= X-Received: by 10.107.22.1 with SMTP id 1mr19151721iow.238.1520277531630; Mon, 05 Mar 2018 11:18:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.135.221 with HTTP; Mon, 5 Mar 2018 11:18:50 -0800 (PST) In-Reply-To: References: <6be06ce5-87e6-0d9d-55b9-6c70c3578ecf@maciej.szmigiero.name> From: Linus Torvalds Date: Mon, 5 Mar 2018 11:18:50 -0800 X-Google-Sender-Auth: LtYe3bJUESP8QRIMRhRctN1_jy0 Message-ID: Subject: Re: RANDSTRUCT structs need linux/compiler_types.h (Was: [nfsd4] potentially hardware breaking regression in 4.14-rc and 4.13.11) To: Masahiro Yamada Cc: "Maciej S. Szmigiero" , Kees Cook , Patrick McLean , Emese Revfy , Al Viro , Bruce Fields , "Darrick J. Wong" , Linux Kernel Mailing List , Linux NFS Mailing List , Thorsten Leemhuis , "kernel-hardening@lists.openwall.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 5, 2018 at 1:27 AM, Masahiro Yamada wrote: > > Can I suggest another way to make it less fragile? > __attribute((...)) can be placed after 'struct'. That avoids the actual bug, but it wouldn't have helped _find_ the problem in the first place. If somebody ever does the same thing, they'd hit the same issue. And it's not just __randomize_struct, it's any of our other type markers. We can say "don't do that", but if there is no automated checking, it's still ripe to cause problems just because somebody didn't notice. So I'd rather have something that causes a build failure when something goes wrong, rather than silently accepting syntax that wasn't intended. Linus