]> git.baikalelectronics.ru Git - kernel.git/commit
kunit: ubsan integration
authorUriel Guajardo <urielguajardo@google.com>
Fri, 2 Apr 2021 21:21:31 +0000 (14:21 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 13 Aug 2021 19:19:06 +0000 (13:19 -0600)
commit8cc32dcd8163493810a8696ec665f2eac8d2a7e1
treef484ff3c2589c4b991491fd13a768d470096a910
parentd0ba32514557d487eb501df2c670277b7357608b
kunit: ubsan integration

Integrates UBSAN into the KUnit testing framework. It fails KUnit tests
whenever it reports undefined behavior.

When CONFIG_KUNIT=n, nothing is printed or even formatted, so this has
no behavioral impact outside of tests.

kunit_fail_current_test() effectively does a pr_err() as well, so
there's some slight duplication, but it also ensures an error is
recorded in the debugfs entry for the running KUnit test.

Print a shorter version of the message to make it less spammy.

Co-developed-by: Daniel Latypov <dlatypov@google.com>
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Signed-off-by: Uriel Guajardo <urielguajardo@google.com>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
lib/ubsan.c