From: Kees Cook <keescook@chromium.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Kees Cook <keescook@chromium.org>,
kernel test robot <lkp@intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Vitor Massaru Iha <vitor@massaru.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Daniel Latypov <dlatypov@google.com>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: [PATCH] lib: overflow: Always build 64-bit test cases
Date: Wed, 11 May 2022 10:45:31 -0700 [thread overview]
Message-ID: <20220511174531.1098548-1-keescook@chromium.org> (raw)
There shouldn't be a reason to not build the 64-bit test cases on 32-bit
systems; the types exist there too. Remove the #ifdefs.
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/202205110324.7GrtxG8u-lkp@intel.com
Fixes: 455a35a6cdb6 ("lib: add runtime test of check_*_overflow functions")
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Vitor Massaru Iha <vitor@massaru.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Daniel Latypov <dlatypov@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
lib/overflow_kunit.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/lib/overflow_kunit.c b/lib/overflow_kunit.c
index 475f0c064bf6..ac37bb543476 100644
--- a/lib/overflow_kunit.c
+++ b/lib/overflow_kunit.c
@@ -255,10 +255,8 @@ DEFINE_TEST_FUNC(u16, "%d");
DEFINE_TEST_FUNC(s16, "%d");
DEFINE_TEST_FUNC(u32, "%u");
DEFINE_TEST_FUNC(s32, "%d");
-#if BITS_PER_LONG == 64
DEFINE_TEST_FUNC(u64, "%llu");
DEFINE_TEST_FUNC(s64, "%lld");
-#endif
static void overflow_shift_test(struct kunit *test)
{
@@ -650,10 +648,8 @@ static struct kunit_case overflow_test_cases[] = {
KUNIT_CASE(s16_overflow_test),
KUNIT_CASE(u32_overflow_test),
KUNIT_CASE(s32_overflow_test),
-#if BITS_PER_LONG == 64
KUNIT_CASE(u64_overflow_test),
KUNIT_CASE(s64_overflow_test),
-#endif
KUNIT_CASE(overflow_shift_test),
KUNIT_CASE(overflow_allocation_test),
KUNIT_CASE(overflow_size_helpers_test),
--
2.32.0
next reply other threads:[~2022-05-11 17:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 17:45 Kees Cook [this message]
2022-05-11 18:27 ` [PATCH] lib: overflow: Always build 64-bit test cases Daniel Latypov
2022-05-12 12:10 ` Rasmus Villemoes
2022-05-16 11:16 ` Rasmus Villemoes
2022-05-16 21:35 ` Nick Desaulniers
2022-05-16 23:01 ` Kees Cook
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=20220511174531.1098548-1-keescook@chromium.org \
--to=keescook@chromium.org \
--cc=dlatypov@google.com \
--cc=gustavoars@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=lkp@intel.com \
--cc=ndesaulniers@google.com \
--cc=vitor@massaru.org \
/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).