From: Shuah Khan <skhan@linuxfoundation.org>
To: Uriel Guajardo <urielguajardojr@gmail.com>, brendanhiggins@google.com
Cc: urielguajardo@google.com, akpm@linux-foundation.org,
keescook@chromium.org, rdunlap@infradead.org,
herbert@gondor.apana.org.au, christian.brauner@ubuntu.com,
peterz@infradead.org, ardb@kernel.og, arnd@arndb.de,
julien.grall@arm.com, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 2/2] kunit: ubsan integration
Date: Mon, 31 Aug 2020 15:29:52 -0600 [thread overview]
Message-ID: <5064a46f-f73f-5833-5eb9-f69a0aecea4e@linuxfoundation.org> (raw)
In-Reply-To: <20200813205722.1384108-2-urielguajardojr@gmail.com>
On 8/13/20 2:57 PM, Uriel Guajardo wrote:
> Integrates UBSAN into the KUnit testing framework. It fails KUnit tests
> whenever it reports undefined behavior.
>
> Signed-off-by: Uriel Guajardo <urielguajardo@google.com>
> ---
> lib/ubsan.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/lib/ubsan.c b/lib/ubsan.c
> index cb9af3f6b77e..1460e2c828c8 100644
> --- a/lib/ubsan.c
> +++ b/lib/ubsan.c
> @@ -14,6 +14,7 @@
> #include <linux/types.h>
> #include <linux/sched.h>
> #include <linux/uaccess.h>
> +#include <kunit/test.h>
>
> #include "ubsan.h"
>
> @@ -137,6 +138,7 @@ static void ubsan_prologue(struct source_location *loc, const char *reason)
> {
> current->in_ubsan++;
>
> + kunit_fail_current_test();
> pr_err("========================================"
> "========================================\n");
> pr_err("UBSAN: %s in %s:%d:%d\n", reason, loc->file_name,
>
I applied this to linux-kselftest kunit for 5.10-rc1.
thanks,
-- Shuah
next prev parent reply other threads:[~2020-08-31 21:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-13 20:57 [PATCH 1/2] kunit: support failure from dynamic analysis tools Uriel Guajardo
2020-08-13 20:57 ` [PATCH 2/2] kunit: ubsan integration Uriel Guajardo
2020-08-31 21:29 ` Shuah Khan [this message]
2020-08-31 21:29 ` [PATCH 1/2] kunit: support failure from dynamic analysis tools Shuah Khan
-- strict thread matches above, loose matches on Subject: below --
2020-08-06 17:43 Uriel Guajardo
2020-08-06 17:43 ` [PATCH 2/2] kunit: ubsan integration Uriel Guajardo
2020-08-10 20:42 ` Brendan Higgins
2020-08-13 20:49 ` Uriel Guajardo
2020-09-02 12:52 ` Qian Cai
2020-09-03 12:38 ` Qian Cai
2020-09-09 3:00 ` Stephen Rothwell
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=5064a46f-f73f-5833-5eb9-f69a0aecea4e@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.og \
--cc=arnd@arndb.de \
--cc=brendanhiggins@google.com \
--cc=christian.brauner@ubuntu.com \
--cc=herbert@gondor.apana.org.au \
--cc=julien.grall@arm.com \
--cc=keescook@chromium.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=urielguajardo@google.com \
--cc=urielguajardojr@gmail.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).