From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH 04/11] Kernel: Enable undefined behaviour sanity checker Date: Wed, 23 Mar 2022 11:45:19 +0000 Message-ID: <4B728932-3A62-4AD4-AF09-0C1CE4C8B65B@ipfire.org> In-Reply-To: <2f4432a0-6b08-9f0e-780c-e86aedfa4969@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1103718961030231000==" List-Id: --===============1103718961030231000== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, The documentation for this says that CONFIG_UBSAN_SANITIZE_ALL will massively= increase the size of the kernel. How much is this? A larger kernel generally means slower execution. Did you p= erform any benchmarks? > On 19 Mar 2022, at 21:09, Peter M=C3=BCller wr= ote: >=20 > Signed-off-by: Peter M=C3=BCller > --- > config/kernel/kernel.config.aarch64-ipfire | 13 ++++++++++++- > config/kernel/kernel.config.armv6l-ipfire | 13 ++++++++++++- > config/kernel/kernel.config.riscv64-ipfire | 13 ++++++++++++- > config/kernel/kernel.config.x86_64-ipfire | 13 ++++++++++++- > 4 files changed, 48 insertions(+), 4 deletions(-) >=20 > diff --git a/config/kernel/kernel.config.aarch64-ipfire b/config/kernel/ker= nel.config.aarch64-ipfire > index d9179c061..b2ef43e51 100644 > --- a/config/kernel/kernel.config.aarch64-ipfire > +++ b/config/kernel/kernel.config.aarch64-ipfire > @@ -8008,7 +8008,18 @@ CONFIG_DEBUG_FS_ALLOW_ALL=3Dy > CONFIG_HAVE_ARCH_KGDB=3Dy > # CONFIG_KGDB is not set > CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=3Dy > -# CONFIG_UBSAN is not set > +CONFIG_UBSAN=3Dy > +# CONFIG_UBSAN_TRAP is not set > +CONFIG_CC_HAS_UBSAN_BOUNDS=3Dy > +CONFIG_UBSAN_BOUNDS=3Dy > +CONFIG_UBSAN_ONLY_BOUNDS=3Dy > +CONFIG_UBSAN_SHIFT=3Dy > +# CONFIG_UBSAN_DIV_ZERO is not set > +CONFIG_UBSAN_BOOL=3Dy > +CONFIG_UBSAN_ENUM=3Dy > +# CONFIG_UBSAN_ALIGNMENT is not set > +CONFIG_UBSAN_SANITIZE_ALL=3Dy > +# CONFIG_TEST_UBSAN is not set > CONFIG_HAVE_KCSAN_COMPILER=3Dy > # end of Generic Kernel Debugging Instruments >=20 > diff --git a/config/kernel/kernel.config.armv6l-ipfire b/config/kernel/kern= el.config.armv6l-ipfire > index 522278160..13326a29c 100644 > --- a/config/kernel/kernel.config.armv6l-ipfire > +++ b/config/kernel/kernel.config.armv6l-ipfire > @@ -7989,7 +7989,18 @@ CONFIG_DEBUG_FS_ALLOW_ALL=3Dy > # CONFIG_DEBUG_FS_ALLOW_NONE is not set > CONFIG_HAVE_ARCH_KGDB=3Dy > # CONFIG_KGDB is not set > -# CONFIG_UBSAN is not set > +CONFIG_UBSAN=3Dy > +# CONFIG_UBSAN_TRAP is not set > +CONFIG_CC_HAS_UBSAN_BOUNDS=3Dy > +CONFIG_UBSAN_BOUNDS=3Dy > +CONFIG_UBSAN_ONLY_BOUNDS=3Dy > +CONFIG_UBSAN_SHIFT=3Dy > +# CONFIG_UBSAN_DIV_ZERO is not set > +CONFIG_UBSAN_BOOL=3Dy > +CONFIG_UBSAN_ENUM=3Dy > +# CONFIG_UBSAN_ALIGNMENT is not set > +CONFIG_UBSAN_SANITIZE_ALL=3Dy > +# CONFIG_TEST_UBSAN is not set > CONFIG_HAVE_KCSAN_COMPILER=3Dy > # end of Generic Kernel Debugging Instruments >=20 > diff --git a/config/kernel/kernel.config.riscv64-ipfire b/config/kernel/ker= nel.config.riscv64-ipfire > index ebb830eb7..fa4ee46fa 100644 > --- a/config/kernel/kernel.config.riscv64-ipfire > +++ b/config/kernel/kernel.config.riscv64-ipfire > @@ -6597,7 +6597,18 @@ CONFIG_HAVE_ARCH_KGDB=3Dy > CONFIG_HAVE_ARCH_KGDB_QXFER_PKT=3Dy > # CONFIG_KGDB is not set > CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=3Dy > -# CONFIG_UBSAN is not set > +CONFIG_UBSAN=3Dy > +# CONFIG_UBSAN_TRAP is not set > +CONFIG_CC_HAS_UBSAN_BOUNDS=3Dy > +CONFIG_UBSAN_BOUNDS=3Dy > +CONFIG_UBSAN_ONLY_BOUNDS=3Dy > +CONFIG_UBSAN_SHIFT=3Dy > +# CONFIG_UBSAN_DIV_ZERO is not set > +CONFIG_UBSAN_BOOL=3Dy > +CONFIG_UBSAN_ENUM=3Dy > +# CONFIG_UBSAN_ALIGNMENT is not set > +CONFIG_UBSAN_SANITIZE_ALL=3Dy > +# CONFIG_TEST_UBSAN is not set > CONFIG_HAVE_KCSAN_COMPILER=3Dy > # end of Generic Kernel Debugging Instruments >=20 > diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/kern= el.config.x86_64-ipfire > index 675c3ce1e..e6a03a9e5 100644 > --- a/config/kernel/kernel.config.x86_64-ipfire > +++ b/config/kernel/kernel.config.x86_64-ipfire > @@ -7430,7 +7430,18 @@ CONFIG_DEBUG_FS_ALLOW_ALL=3Dy > CONFIG_HAVE_ARCH_KGDB=3Dy > # CONFIG_KGDB is not set > CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=3Dy > -# CONFIG_UBSAN is not set > +CONFIG_UBSAN=3Dy > +# CONFIG_UBSAN_TRAP is not set > +CONFIG_CC_HAS_UBSAN_BOUNDS=3Dy > +CONFIG_UBSAN_BOUNDS=3Dy > +CONFIG_UBSAN_ONLY_BOUNDS=3Dy > +CONFIG_UBSAN_SHIFT=3Dy > +# CONFIG_UBSAN_DIV_ZERO is not set > +CONFIG_UBSAN_BOOL=3Dy > +CONFIG_UBSAN_ENUM=3Dy > +# CONFIG_UBSAN_ALIGNMENT is not set > +CONFIG_UBSAN_SANITIZE_ALL=3Dy > +# CONFIG_TEST_UBSAN is not set > CONFIG_HAVE_ARCH_KCSAN=3Dy > CONFIG_HAVE_KCSAN_COMPILER=3Dy > # CONFIG_KCSAN is not set > --=20 > 2.34.1 --===============1103718961030231000==--