mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kselftest@vger.kernel.org,
	"David Airlie" <airlied@gmail.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Maíra Canal" <mcanal@igalia.com>,
	"Dan Carpenter" <dan.carpenter@linaro.org>,
	"Daniel Diaz" <daniel.diaz@linaro.org>,
	"David Gow" <davidgow@google.com>,
	"Arthur Grillo" <arthurgrillo@riseup.net>,
	"Brendan Higgins" <brendan.higgins@linux.dev>,
	"Naresh Kamboju" <naresh.kamboju@linaro.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	loongarch@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	kunit-dev@googlegroups.com, linux-arch@vger.kernel.org
Subject: Re: [RFC PATCH 1/5] bug: Core support for suppressing warning backtraces
Date: Tue, 5 Mar 2024 12:17:55 -0800	[thread overview]
Message-ID: <0f5d6a76-98dc-4cbb-9896-da4891f1de5f@roeck-us.net> (raw)
In-Reply-To: <202403051149.547235C794@keescook>

On 3/5/24 11:54, Kees Cook wrote:
> On Tue, Mar 05, 2024 at 10:40:29AM -0800, Guenter Roeck wrote:
>> [...]
>>   	warning = (bug->flags & BUGFLAG_WARNING) != 0;
>>   	once = (bug->flags & BUGFLAG_ONCE) != 0;
>>   	done = (bug->flags & BUGFLAG_DONE) != 0;
>>   
>> +	if (warning && IS_SUPPRESSED_WARNING(function))
>> +		return BUG_TRAP_TYPE_WARN;
>> +
> 
> I had to re-read __report_bug() more carefully, but yes, this works --
> it's basically leaving early, like "once" does.
> 
> This looks like a reasonable approach!
> 
> Something very similar to this is checking that a warning happens. i.e.
> you talk about drm selftests checking function return values, but I've
> got a bunch of tests (LKDTM) that live outside of KUnit because I haven't
> had a clean way to check for specific warnings/bugs. I feel like future
> changes built on top of this series could add counters or something that
> KUnit could examine. E.g. I did this manually for some fortify tests:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/hardening&id=4ce615e798a752d4431fcc52960478906dec2f0e
> 

Sounds like a good idea. It should be straightforward to add a counter
to struct __suppressed_warning. This way the calling code could easily
check if an expected warning backtrace actually happened.

Thanks,
Guenter


  reply	other threads:[~2024-03-05 20:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 18:40 [RFC PATCH 0/5] Add " Guenter Roeck
2024-03-05 18:40 ` [RFC PATCH 1/5] bug: Core " Guenter Roeck
2024-03-05 19:54   ` Kees Cook
2024-03-05 20:17     ` Guenter Roeck [this message]
2024-03-05 18:40 ` [RFC PATCH 2/5] drm: Suppress intentional warning backtraces in scaling unit tests Guenter Roeck
2024-03-05 18:40 ` [RFC PATCH 3/5] x86: Add support for suppressing warning tracebacks Guenter Roeck
2024-03-05 18:40 ` [RFC PATCH 4/5] arm64: " Guenter Roeck
2024-03-05 18:40 ` [RFC PATCH 5/5] loongarch: " Guenter Roeck
2024-03-06 18:24 ` [RFC PATCH 0/5] Add support for suppressing warning backtraces Daniel Díaz
2024-03-06 18:57   ` Guenter Roeck
2024-03-11  4:36 ` Guenter Roeck

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=0f5d6a76-98dc-4cbb-9896-da4891f1de5f@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=arthurgrillo@riseup.net \
    --cc=brendan.higgins@linux.dev \
    --cc=dan.carpenter@linaro.org \
    --cc=daniel.diaz@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=davidgow@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=keescook@chromium.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mcanal@igalia.com \
    --cc=mripard@kernel.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=tzimmermann@suse.de \
    --cc=ville.syrjala@linux.intel.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®