1 |
commit: 91e82d6ce6213596c5a31f96c3371cbe7167ea34 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 11 16:50:04 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 11 16:54:11 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=91e82d6c |
7 |
|
8 |
Update Gentoo Hardened patchset based on KSPP thanks to Peter Bo |
9 |
|
10 |
Bug: https://bugs.gentoo.org/841488 |
11 |
|
12 |
Added: |
13 |
CONFIG_HARDENED_USERCOPY=y |
14 |
CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y |
15 |
CONFIG_KFENCE=y |
16 |
CONFIG_IOMMU_DEFAULT_DMA_STRICT=y |
17 |
CONFIG_SCHED_CORE=y |
18 |
CONFIG_ZERO_CALL_USED_REGS=y |
19 |
|
20 |
Dropped deprecated option: |
21 |
!DEVKMEM |
22 |
|
23 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
24 |
|
25 |
4567_distro-Gentoo-Kconfig.patch | 17 +++++++++++------ |
26 |
1 file changed, 11 insertions(+), 6 deletions(-) |
27 |
|
28 |
diff --git a/4567_distro-Gentoo-Kconfig.patch b/4567_distro-Gentoo-Kconfig.patch |
29 |
index 9843c3e2..77ae7dc1 100644 |
30 |
--- a/4567_distro-Gentoo-Kconfig.patch |
31 |
+++ b/4567_distro-Gentoo-Kconfig.patch |
32 |
@@ -1,14 +1,14 @@ |
33 |
---- a/Kconfig 2022-04-12 13:11:48.403113171 -0400 |
34 |
-+++ b/Kconfig 2022-04-12 13:12:36.530084675 -0400 |
35 |
+--- a/Kconfig 2022-05-11 08:37:26.685387031 -0400 |
36 |
++++ b/Kconfig 2022-05-11 08:38:35.672171690 -0400 |
37 |
@@ -30,3 +30,5 @@ source "lib/Kconfig" |
38 |
source "lib/Kconfig.debug" |
39 |
|
40 |
source "Documentation/Kconfig" |
41 |
+ |
42 |
+source "distro/Kconfig" |
43 |
---- /dev/null 2022-04-12 05:39:54.696333295 -0400 |
44 |
-+++ b/distro/Kconfig 2022-04-12 13:21:04.666379519 -0400 |
45 |
-@@ -0,0 +1,285 @@ |
46 |
+--- /dev/null 2022-05-10 13:47:17.750578524 -0400 |
47 |
++++ b/distro/Kconfig 2022-05-11 12:43:39.114196110 -0400 |
48 |
+@@ -0,0 +1,290 @@ |
49 |
+menu "Gentoo Linux" |
50 |
+ |
51 |
+config GENTOO_LINUX |
52 |
@@ -185,7 +185,7 @@ |
53 |
+config GENTOO_KERNEL_SELF_PROTECTION_COMMON |
54 |
+ bool "Enable Kernel Self Protection Project Recommendations" |
55 |
+ |
56 |
-+ depends on GENTOO_LINUX && !ACPI_CUSTOM_METHOD && !COMPAT_BRK && !DEVKMEM && !PROC_KCORE && !COMPAT_VDSO && !KEXEC && !HIBERNATION && !LEGACY_PTYS && !X86_X32 && !MODIFY_LDT_SYSCALL && GCC_PLUGINS |
57 |
++ depends on GENTOO_LINUX && !ACPI_CUSTOM_METHOD && !COMPAT_BRK && !PROC_KCORE && !COMPAT_VDSO && !KEXEC && !HIBERNATION && !LEGACY_PTYS && !X86_X32 && !MODIFY_LDT_SYSCALL && GCC_PLUGINS && !IOMMU_DEFAULT_DMA_LAZY && !IOMMU_DEFAULT_PASSTHROUGH && IOMMU_DEFAULT_DMA_STRICT |
58 |
+ |
59 |
+ select BUG |
60 |
+ select STRICT_KERNEL_RWX |
61 |
@@ -199,7 +199,11 @@ |
62 |
+ select DEBUG_NOTIFIERS |
63 |
+ select DEBUG_LIST |
64 |
+ select DEBUG_SG |
65 |
++ select HARDENED_USERCOPY if HAVE_HARDENED_USERCOPY_ALLOCATOR=y |
66 |
+ select BUG_ON_DATA_CORRUPTION |
67 |
++ select KFENCE if HAVE_ARCH_KFENCE && (!SLAB || SLUB) |
68 |
++ select RANDOMIZE_KSTACK_OFFSET_DEFAULT if HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET && (INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION>=140000) |
69 |
++ select SCHED_CORE if SCHED_SMT |
70 |
+ select SCHED_STACK_END_CHECK |
71 |
+ select SECCOMP if HAVE_ARCH_SECCOMP |
72 |
+ select SECCOMP_FILTER if HAVE_ARCH_SECCOMP_FILTER |
73 |
@@ -222,6 +226,7 @@ |
74 |
+ select GCC_PLUGIN_STRUCTLEAK_BYREF_ALL |
75 |
+ select GCC_PLUGIN_RANDSTRUCT |
76 |
+ select GCC_PLUGIN_RANDSTRUCT_PERFORMANCE |
77 |
++ select ZERO_CALL_USED_REGS if CC_HAS_ZERO_CALL_USED_REGS |
78 |
+ |
79 |
+ help |
80 |
+ Search for GENTOO_KERNEL_SELF_PROTECTION_{X86_64, ARM64, X86_32, ARM} for dependency |