mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
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)
Date: Sun, 18 Feb 2018 15:20:22 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1802181519400.205822@chino.kir.corp.google.com> (raw)
In-Reply-To: <20180217191035.gol4woxsgzpo4bfq@gmail.com>

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 <miguel.ojeda.sandonis@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Josh Poimboeuf <jpoimboe@redhat.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: David Rientjes <rientjes@google.com>

I would have expected to have seen __nonstring used somewhere as part of 
this patch.

  reply	other threads:[~2018-02-18 23:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 19:10 Miguel Ojeda
2018-02-18 23:20 ` David Rientjes [this message]
2018-02-19  0:01   ` Miguel Ojeda
2018-03-01  9:57     ` Arnd Bergmann
2018-03-02 17:36       ` Miguel Ojeda
2018-03-05 19:05         ` Martin Sebor
2018-03-07 12:20           ` Miguel Ojeda
2018-03-13 15:41             ` Martin Sebor
2018-03-13 15:57               ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1802181519400.205822@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®