Skip to content

Commit b0a9ba1

Browse files
committed
Merge tag 'hardening-v6.10-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening fixes from Kees Cook: - loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression (Stephen Boyd) - ubsan: Restore dependency on ARCH_HAS_UBSAN - kunit/fortify: Fix memcmp() test to be amplitude agnostic * tag 'hardening-v6.10-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: kunit/fortify: Fix memcmp() test to be amplitude agnostic ubsan: Restore dependency on ARCH_HAS_UBSAN loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression
2 parents 0eb03c7 + ae1a863 commit b0a9ba1

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/Kconfig.ubsan

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config ARCH_HAS_UBSAN
44

55
menuconfig UBSAN
66
bool "Undefined behaviour sanity checker"
7+
depends on ARCH_HAS_UBSAN
78
help
89
This option enables the Undefined Behaviour sanity checker.
910
Compile-time instrumentation is used to detect various undefined

lib/fortify_kunit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ static void fortify_test_memcmp(struct kunit *test)
990990
KUNIT_ASSERT_EQ(test, memcmp(one, two, one_len), 0);
991991
KUNIT_EXPECT_EQ(test, fortify_read_overflows, 0);
992992
/* Still in bounds, but no longer matching. */
993-
KUNIT_ASSERT_EQ(test, memcmp(one, two, one_len + 1), -32);
993+
KUNIT_ASSERT_LT(test, memcmp(one, two, one_len + 1), 0);
994994
KUNIT_EXPECT_EQ(test, fortify_read_overflows, 0);
995995

996996
/* Catch too-large ranges. */

security/loadpin/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ config SECURITY_LOADPIN
1414
config SECURITY_LOADPIN_ENFORCE
1515
bool "Enforce LoadPin at boot"
1616
depends on SECURITY_LOADPIN
17+
# Module compression breaks LoadPin unless modules are decompressed in
18+
# the kernel.
19+
depends on !MODULES || (MODULE_COMPRESS_NONE || MODULE_DECOMPRESS)
1720
help
1821
If selected, LoadPin will enforce pinning at boot. If not
1922
selected, it can be enabled at boot with the kernel parameter

0 commit comments

Comments
 (0)