public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Gustavo A . R . Silva" <gustavoars@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nicolas.schier@linux.dev>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	linux-kbuild@vger.kernel.org,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Tamir Duberstein" <tamird@gmail.com>,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] kbuild: Enable GCC diagnostic context for value-tracking warnings
Date: Fri, 21 Nov 2025 10:32:09 -0800	[thread overview]
Message-ID: <202511211030.87A256197A@keescook> (raw)
In-Reply-To: <CANiq72=tzUPrDd2=GBnqxm_PmjF9nT3iVJ5ZT6AiZQqkjvdH_g@mail.gmail.com>

On Thu, Nov 20, 2025 at 09:17:16AM +0100, Miguel Ojeda wrote:
> On Wed, Nov 19, 2025 at 11:44 PM Kees Cook <kees@kernel.org> wrote:
> >
> > Enable GCC 16's coming "-fdiagnostics-show-context=2" option[1] to
> > provide enhanced diagnostic information for value-tracking warnings, which
> > displays the control flow chain leading to the diagnostic. This covers our
> 
> > existing use of -Wrestrict and -Wstringop-overread, and gets us closer to
> > enabling -Warray-bounds, -Wstringop-overflow, and -Wstringop-truncation.
> 
> I am probably missing some context, but in what sense gets us closer?
> Do you mean it will make it easier to understand those when we enable
> them? i.e. we still can't enable them until the minimum is upgraded,
> right?

Right -- we've been tracking down -Warray-bounds warnings for several
years now and it has been quite difficult to determine which are "real"
and which are false positives. This option makes the "real" cases much
more obvious.

I will improve the commit log.

> Apart from that, it looks like a nice improvement on the output from
> the PR examples -- I didn't test it, but the patch itself looks fine
> of course:
> 
> Reviewed-by: Miguel Ojeda <ojeda@kernel.org>

Thanks!

-- 
Kees Cook

      reply	other threads:[~2025-11-21 18:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 22:44 [PATCH] kbuild: Enable GCC diagnostic context for value-tracking warnings Kees Cook
2025-11-20  6:49 ` Nathan Chancellor
2025-11-21 18:30   ` Kees Cook
2025-11-20  8:17 ` Miguel Ojeda
2025-11-21 18:32   ` Kees Cook [this message]

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=202511211030.87A256197A@keescook \
    --to=kees@kernel.org \
    --cc=gustavoars@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=nathan@kernel.org \
    --cc=nicolas.schier@linux.dev \
    --cc=ojeda@kernel.org \
    --cc=tamird@gmail.com \
    --cc=thomas.weissschuh@linutronix.de \
    /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