From: Kees Cook <keescook@chromium.org>
To: linux-hardening@vger.kernel.org
Cc: Kees Cook <keescook@chromium.org>,
Fangrui Song <maskray@google.com>,
Justin Stitt <justinstitt@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Nicolas Schier <nicolas@fjasle.eu>,
Bill Wendling <morbo@google.com>, Marco Elver <elver@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
x86@kernel.org, linux-kernel@vger.kernel.org,
linux-kbuild@vger.kernel.org, llvm@lists.linux.dev,
linux-doc@vger.kernel.org, netdev@vger.kernel.org,
linux-crypto@vger.kernel.org, kasan-dev@googlegroups.com,
linux-acpi@vger.kernel.org
Subject: [PATCH v2 0/6] ubsan: Introduce wrap-around sanitizers
Date: Fri, 2 Feb 2024 02:16:33 -0800 [thread overview]
Message-ID: <20240202101311.it.893-kees@kernel.org> (raw)
Hi,
v2:
- improve CC list
- add reviewed-by tags
- reword some commit logs
v1: https://lore.kernel.org/all/20240129175033.work.813-kees@kernel.org/
Lay the ground work for gaining instrumentation for signed[1],
unsigned[2], and pointer[3] wrap-around by making all 3 sanitizers
available for testing. Additionally gets x86_64 bootable under the
unsigned sanitizer for the first time.
The compilers will need work before this can be generally useful, as the
signed and pointer sanitizers are effectively a no-op with the kernel's
required use of -fno-strict-overflow. The unsigned sanitizer will also
need adjustment to deal with the many common code patterns that exist
for unsigned wrap-around (e.g. "while (var--)", "-1UL", etc).
-Kees
Link: https://github.com/KSPP/linux/issues/26 [1]
Link: https://github.com/KSPP/linux/issues/27 [2]
Link: https://github.com/KSPP/linux/issues/344 [3]
Kees Cook (6):
ubsan: Use Clang's -fsanitize-trap=undefined option
ubsan: Reintroduce signed and unsigned overflow sanitizers
ubsan: Introduce CONFIG_UBSAN_POINTER_WRAP
ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL
ubsan: Split wrapping sanitizer Makefile rules
ubsan: Get x86_64 booting with unsigned wrap-around sanitizer
Documentation/dev-tools/ubsan.rst | 28 +++-------
arch/arm/Kconfig | 2 +-
arch/arm64/Kconfig | 2 +-
arch/mips/Kconfig | 2 +-
arch/parisc/Kconfig | 2 +-
arch/powerpc/Kconfig | 2 +-
arch/riscv/Kconfig | 2 +-
arch/s390/Kconfig | 2 +-
arch/x86/Kconfig | 2 +-
arch/x86/kernel/Makefile | 1 +
arch/x86/kernel/apic/Makefile | 1 +
arch/x86/mm/Makefile | 1 +
arch/x86/mm/pat/Makefile | 1 +
crypto/Makefile | 1 +
drivers/acpi/Makefile | 1 +
include/linux/compiler_types.h | 19 ++++++-
kernel/Makefile | 1 +
kernel/locking/Makefile | 1 +
kernel/rcu/Makefile | 1 +
kernel/sched/Makefile | 1 +
lib/Kconfig.ubsan | 41 +++++++++-----
lib/Makefile | 1 +
lib/crypto/Makefile | 1 +
lib/crypto/mpi/Makefile | 1 +
lib/test_ubsan.c | 82 ++++++++++++++++++++++++++++
lib/ubsan.c | 89 +++++++++++++++++++++++++++++++
lib/ubsan.h | 5 ++
lib/zlib_deflate/Makefile | 1 +
lib/zstd/Makefile | 2 +
mm/Makefile | 1 +
net/core/Makefile | 1 +
net/ipv4/Makefile | 1 +
scripts/Makefile.lib | 11 +++-
scripts/Makefile.ubsan | 11 +++-
34 files changed, 278 insertions(+), 43 deletions(-)
--
2.34.1
next reply other threads:[~2024-02-02 10:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 10:16 Kees Cook [this message]
2024-02-02 10:16 ` [PATCH v2 1/6] ubsan: Use Clang's -fsanitize-trap=undefined option Kees Cook
2024-02-02 10:16 ` [PATCH v2 2/6] ubsan: Reintroduce signed and unsigned overflow sanitizers Kees Cook
2024-02-02 11:01 ` Marco Elver
2024-02-02 12:17 ` Kees Cook
2024-02-02 13:44 ` Marco Elver
2024-02-02 16:08 ` Miguel Ojeda
2024-02-02 10:16 ` [PATCH v2 3/6] ubsan: Introduce CONFIG_UBSAN_POINTER_WRAP Kees Cook
2024-02-02 10:16 ` [PATCH v2 4/6] ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL Kees Cook
2024-02-02 10:16 ` [PATCH v2 5/6] ubsan: Split wrapping sanitizer Makefile rules Kees Cook
2024-02-02 10:16 ` [PATCH v2 6/6] ubsan: Get x86_64 booting with unsigned wrap-around sanitizer 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=20240202101311.it.893-kees@kernel.org \
--to=keescook@chromium.org \
--cc=andreyknvl@gmail.com \
--cc=corbet@lwn.net \
--cc=elver@google.com \
--cc=justinstitt@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=masahiroy@kernel.org \
--cc=maskray@google.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas@fjasle.eu \
--cc=x86@kernel.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).