Received: by 10.223.185.116 with SMTP id b49csp3142213wrg; Sun, 18 Feb 2018 15:21:48 -0800 (PST) X-Google-Smtp-Source: AH8x227+lw+pNSPeIu7rKOPp2cLktJmfn4J8KPJv9QUgXUdEX52IdGXxfjJP4wjgOs0nwCDc4rd0 X-Received: by 10.101.67.137 with SMTP id m9mr3217167pgp.301.1518996108599; Sun, 18 Feb 2018 15:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518996108; cv=none; d=google.com; s=arc-20160816; b=C3O6+xCEcF9PxmiPizcq+pvVU0E7KQq057l/J+6P6NToL2gLSGd9MQbBkp2jCf1GXN 99yTK98ZUNs87PD08JQd94GH+/6d0jAbAvG7pBBfezXUMSTYKrtCiVxZeSruK2y/QlUh YZOLmTIPOsVYyRmYWwgI0xATrkAKjCS5J7F3n2dEEhhqEqhvTZVdWdewGPg14T+a3Mjm yKYH+37EMDI666MO59Woe/63pvqxyvN4L9cnyyjp7v6f2agdas5Oc/Jhw9MgvUgUWWDj 1RawoGs/LtqDnOSEMMM3SadfHFK7rXTfR7PyeCr+f2MO3Fbjg3Dj0v65ai2qSrOpmjS1 /L8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=8Vcs4oUCl13hzwYFZArR84tDNwtQ4fXRFs8Y1ZZkkC0=; b=pVtPHbejAJfahD+oPZqDzdeB1V+GCm/6lPGtx3fsE8KK87kcFPCcSI3ZDG3VCUrnQz TbMVM9AMcx8ki0dFDeYqGQm8zjxSg5I+5uXazFCvQPF/fkV6EMSb9lY/3/Jz4+PxZXax RK0+rYjNrOCyRDO7tDQYXQSQlYSLq6TPCNLzAPnYBL6cv9tPRRTgfFKhJeJQnZMOQ74n P0EnTiomNpYlKKElDpD2nvExAxTe4ZsC0kG3CFyOrWx3GtGVAWGO5zp3Eyi4wHTnpOvX 7jwewAWZVJnATloFg9MawvuahZMttkfOFqfwDteBtPspAleAp8V6/CSVX13LqTGY/xxj TJUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aCSFyx2J; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si10060705pfb.298.2018.02.18.15.21.34; Sun, 18 Feb 2018 15:21:48 -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=pass header.i=@google.com header.s=20161025 header.b=aCSFyx2J; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751921AbeBRXU0 (ORCPT + 99 others); Sun, 18 Feb 2018 18:20:26 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:37275 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbeBRXUZ (ORCPT ); Sun, 18 Feb 2018 18:20:25 -0500 Received: by mail-it0-f66.google.com with SMTP id d10so7496043itj.2 for ; Sun, 18 Feb 2018 15:20:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=8Vcs4oUCl13hzwYFZArR84tDNwtQ4fXRFs8Y1ZZkkC0=; b=aCSFyx2JM8q4qufXDLPpte0XsHbopjIVGDchhuTq+U3WX7SjKOHdCK0zTd/cS9o3Wv +4+Pu7aj44xF1njAqvmyMG5VBCl0HgKU1gZqo7FiBo8zxkXg7g4Nbq05nMYCaYaePv+C Ux//kV6bxeR8fOi2+XAoKwZpJr8FAfznGHb8Qc3Rz6tZ6eZcjc1Ql8Xa5v4WWccOsvtO KM9r9CdvVuCg/j6los1vS2WwNbGHRFd4HLT9T8Wf4Kw/9nfy2mZGVx0SbtAimGl5g2ZD y6t6fnjx91RbMC2Os//OCbvwmyUFagsiNoJSDSuvMA6WQZtAx6qtLi3E/YXXOdsqhcxc Gc4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=8Vcs4oUCl13hzwYFZArR84tDNwtQ4fXRFs8Y1ZZkkC0=; b=jFYDmTwqsmy5Fx2jQwq3RsKrD/AB0+pcpu/cI3Gjq9KeDChfGTfqGJlqaCm8O33t1H g2fGG8VnKp7D4IWQtlGqxdnKHzFuiOV32qDFdc8m58IggGxbptamyO1wtCJdOm+I0Qjr 9bIc6POzPksLAYWOM7tscYh7cx2KyMSEYaLRRwkzFVnwN4nfIX7z30H+N+/PNktJzsfW aA2d3gGrpwgkbMnGdsu5ZgNm8zOChsGNaK0VXVcIl+XqB2wEfvzY6MTSbYTfu2NK20gn NtyWw7rGWEYnCeHfcaxna6OARYw2xfThzHfJ7uPLSZmAL9Cpk1GOre8qUEuqTH5VGys2 Yytg== X-Gm-Message-State: APf1xPCXmlMr2ObgfrZ+lDgqIuHcDRawS7dmiYdjJDu25dOTAyz0Vhh3 SHEk4zKPRzo2Ec7liAAw/5VHJA== X-Received: by 10.36.47.66 with SMTP id j63mr16919154itj.116.1518996024645; Sun, 18 Feb 2018 15:20:24 -0800 (PST) Received: from [2620:15c:17:3:fd56:ed68:a2a8:6732] ([2620:15c:17:3:fd56:ed68:a2a8:6732]) by smtp.gmail.com with ESMTPSA id o187sm5405287iof.66.2018.02.18.15.20.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Feb 2018 15:20:23 -0800 (PST) Date: Sun, 18 Feb 2018 15:20:22 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Miguel Ojeda cc: mingo@kernel.org, jpoimboe@redhat.com, keescook@chromium.org, akpm@linux-foundation.org, tglx@linutronix.de, geert@linux-m68k.org, gregkh@linuxfoundation.org, thomas.lendacky@amd.com, will.deacon@arm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Support the nonstring variable attribute (gcc >= 8) In-Reply-To: <20180217191035.gol4woxsgzpo4bfq@gmail.com> Message-ID: References: <20180217191035.gol4woxsgzpo4bfq@gmail.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 17 Feb 2018, Miguel Ojeda wrote: > From the GCC manual: > > The nonstring variable attribute specifies that an object or member > declaration with type array of char or pointer to char is intended to > store character arrays that do not necessarily contain a terminating NUL > character. This is useful in detecting uses of such arrays or pointers > with functions that expect NUL-terminated strings, and to avoid warnings > when such an array or pointer is used as an argument to a bounded string > manipulation function such as strncpy. > > https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html > > Some reports are already coming to the LKML regarding these > warnings. When they are false positives, we can use __nonstring to let > gcc know a NUL character is not required; like in this case: > > https://lkml.org/lkml/2018/1/16/135 > > Signed-off-by: Miguel Ojeda > Cc: Ingo Molnar > Cc: Josh Poimboeuf > Cc: Kees Cook > Cc: Andrew Morton > Cc: Geert Uytterhoeven > Cc: Will Deacon > Cc: Greg Kroah-Hartman > Cc: David Rientjes I would have expected to have seen __nonstring used somewhere as part of this patch.