linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Guenter Roeck <linux@roeck-us.net>
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 11:54:06 -0800	[thread overview]
Message-ID: <202403051149.547235C794@keescook> (raw)
In-Reply-To: <20240305184033.425294-2-linux@roeck-us.net>

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

-Kees

-- 
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-03-05 19:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 18:40 [RFC PATCH 0/5] Add support for suppressing warning backtraces Guenter Roeck
2024-03-05 18:40 ` [RFC PATCH 1/5] bug: Core " Guenter Roeck
2024-03-05 19:54   ` Kees Cook [this message]
2024-03-05 20:17     ` Guenter Roeck
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=202403051149.547235C794@keescook \
    --to=keescook@chromium.org \
    --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=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=linux@roeck-us.net \
    --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;
as well as URLs for NNTP newsgroup(s).