Skip to content

Commit 354489d

Browse files
committed
1 parent b1578e9 commit 354489d

6 files changed

+46
-148
lines changed

sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-6.12.0.ebuild

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ UNIPATCH_LIST="
3838
${PATCH_DIR}/z0001-kbuild-derive-relative-path-for-srctree-from-CURDIR.patch \
3939
${PATCH_DIR}/z0002-pahole-support-reproducible-builds.patch \
4040
${PATCH_DIR}/z0003-Revert-x86-boot-Remove-the-bugger-off-message.patch \
41-
${PATCH_DIR}/z0004-efi-Add-an-EFI_SECURE_BOOT-flag-to-indicate-secure-b.patch \
42-
${PATCH_DIR}/z0005-efi-Lock-down-the-kernel-if-booted-in-secure-boot-mo.patch \
43-
${PATCH_DIR}/z0006-mtd-phram-slram-Disable-when-the-kernel-is-locked-do.patch \
44-
${PATCH_DIR}/z0007-arm64-add-kernel-config-option-to-lock-down-when-in-.patch \
41+
${PATCH_DIR}/z0004-efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch \
42+
${PATCH_DIR}/z0005-efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch \
43+
${PATCH_DIR}/z0006-mtd-disable-slram-and-phram-when-locked-down.patch \
44+
${PATCH_DIR}/z0007-arm64-add-kernel-config-option-to-lock-down-when.patch \
4545
${PATCH_DIR}/z0008-tools-hv-fix-cross-compilation-for-ARM64.patch \
4646
"

sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-sources/files/6.12/z0002-pahole-remove-parallel-j-flag.patch

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
From 1e2ffbec195c89d887bc088691ebb19c9173ecad Mon Sep 17 00:00:00 2001
21
From: David Howells <dhowells@redhat.com>
32
Date: Mon, 18 Feb 2019 12:45:03 +0000
4-
Subject: [PATCH 1/4] efi: Add an EFI_SECURE_BOOT flag to indicate secure boot
5-
mode
3+
Subject: [28/30] efi: Add an EFI_SECURE_BOOT flag to indicate secure boot mode
4+
Origin: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit?id=a5d70c55c603233c192b375f72116a395909da28
65

76
UEFI machines can be booted in Secure Boot mode. Add an EFI_SECURE_BOOT
87
flag that can be passed to efi_enabled() to find out whether secure boot is
@@ -26,15 +25,13 @@ cc: linux-efi@vger.kernel.org
2625
arch/x86/kernel/setup.c | 14 +----------
2726
drivers/firmware/efi/Makefile | 1 +
2827
drivers/firmware/efi/secureboot.c | 39 +++++++++++++++++++++++++++++++
29-
include/linux/efi.h | 17 ++++++++------
30-
4 files changed, 51 insertions(+), 20 deletions(-)
28+
include/linux/efi.h | 16 ++++++++-----
29+
4 files changed, 51 insertions(+), 19 deletions(-)
3130
create mode 100644 drivers/firmware/efi/secureboot.c
3231

33-
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
34-
index eb129277dcdd..7c4a6697e39d 100644
3532
--- a/arch/x86/kernel/setup.c
3633
+++ b/arch/x86/kernel/setup.c
37-
@@ -1190,19 +1190,7 @@ void __init setup_arch(char **cmdline_p)
34+
@@ -1193,19 +1193,7 @@ void __init setup_arch(char **cmdline_p)
3835
/* Allocate bigger log buffer */
3936
setup_log_buf(1);
4037

@@ -55,21 +52,16 @@ index eb129277dcdd..7c4a6697e39d 100644
5552

5653
reserve_initrd();
5754

58-
diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
59-
index e489fefd23da..f2dfae764fb5 100644
6055
--- a/drivers/firmware/efi/Makefile
6156
+++ b/drivers/firmware/efi/Makefile
62-
@@ -25,6 +25,7 @@ subdir-$(CONFIG_EFI_STUB) += libstub
57+
@@ -25,6 +25,7 @@ obj-$(CONFIG_EFI_FAKE_MEMMAP) += fake_m
6358
obj-$(CONFIG_EFI_BOOTLOADER_CONTROL) += efibc.o
6459
obj-$(CONFIG_EFI_TEST) += test/
6560
obj-$(CONFIG_EFI_DEV_PATH_PARSER) += dev-path-parser.o
6661
+obj-$(CONFIG_EFI) += secureboot.o
6762
obj-$(CONFIG_APPLE_PROPERTIES) += apple-properties.o
6863
obj-$(CONFIG_EFI_RCI2_TABLE) += rci2-table.o
6964
obj-$(CONFIG_EFI_EMBEDDED_FIRMWARE) += embedded-firmware.o
70-
diff --git a/drivers/firmware/efi/secureboot.c b/drivers/firmware/efi/secureboot.c
71-
new file mode 100644
72-
index 000000000000..b6620669e32b
7365
--- /dev/null
7466
+++ b/drivers/firmware/efi/secureboot.c
7567
@@ -0,0 +1,39 @@
@@ -112,11 +104,9 @@ index 000000000000..b6620669e32b
112104
+ }
113105
+ }
114106
+}
115-
diff --git a/include/linux/efi.h b/include/linux/efi.h
116-
index 80b21d1c6eaf..d267ddba8369 100644
117107
--- a/include/linux/efi.h
118108
+++ b/include/linux/efi.h
119-
@@ -871,6 +871,14 @@ extern int __init efi_setup_pcdp_console(char *);
109+
@@ -871,6 +871,14 @@ extern int __init efi_setup_pcdp_console
120110
#define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */
121111
#define EFI_MEM_NO_SOFT_RESERVE 11 /* Is the kernel configured to ignore soft reservations? */
122112
#define EFI_PRESERVE_BS_REGIONS 12 /* Are EFI boot-services memory segments available? */
@@ -131,23 +121,23 @@ index 80b21d1c6eaf..d267ddba8369 100644
131121

132122
#ifdef CONFIG_EFI
133123
/*
134-
@@ -895,6 +903,7 @@ static inline bool efi_rt_services_supported(unsigned int mask)
124+
@@ -895,6 +903,7 @@ static inline bool efi_rt_services_suppo
135125
return (efi.runtime_supported_mask & mask) == mask;
136126
}
137127
extern void efi_find_mirror(void);
138128
+extern void __init efi_set_secure_boot(enum efi_secureboot_mode mode);
139129
#else
140130
static inline bool efi_enabled(int feature)
141131
{
142-
@@ -914,6 +923,7 @@ static inline bool efi_rt_services_supported(unsigned int mask)
132+
@@ -914,6 +923,7 @@ static inline bool efi_rt_services_suppo
143133
}
144134

145135
static inline void efi_find_mirror(void) {}
146136
+static inline void efi_set_secure_boot(enum efi_secureboot_mode mode) {}
147137
#endif
148138

149139
extern int efi_status_to_err(efi_status_t status);
150-
@@ -1133,13 +1143,6 @@ static inline bool efi_runtime_disabled(void) { return true; }
140+
@@ -1133,13 +1143,6 @@ static inline bool efi_runtime_disabled(
151141
extern void efi_call_virt_check_flags(unsigned long flags, const void *caller);
152142
extern unsigned long efi_call_virt_save_flags(void);
153143

@@ -161,6 +151,3 @@ index 80b21d1c6eaf..d267ddba8369 100644
161151
static inline
162152
enum efi_secureboot_mode efi_get_secureboot_mode(efi_get_variable_t *get_var)
163153
{
164-
--
165-
2.39.2
166-
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
2626

2727
--- a/arch/x86/kernel/setup.c
2828
+++ b/arch/x86/kernel/setup.c
29-
@@ -900,6 +900,8 @@ void __init setup_arch(char **cmdline_p)
29+
@@ -904,6 +904,8 @@ void __init setup_arch(char **cmdline_p)
3030
if (efi_enabled(EFI_BOOT))
3131
efi_init();
3232

@@ -35,7 +35,7 @@ Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
3535
reserve_ibft_region();
3636
x86_init.resources.dmi_setup();
3737

38-
@@ -1061,8 +1063,6 @@ void __init setup_arch(char **cmdline_p)
38+
@@ -1070,8 +1072,6 @@ void __init setup_arch(char **cmdline_p)
3939
/* Allocate bigger log buffer */
4040
setup_log_buf(1);
4141

@@ -67,26 +67,26 @@ Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
6767
default:
6868
--- a/include/linux/security.h
6969
+++ b/include/linux/security.h
70-
@@ -509,6 +509,7 @@ int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
70+
@@ -522,6 +522,7 @@ int security_inode_notifysecctx(struct i
71+
int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
72+
int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
7173
int security_locked_down(enum lockdown_reason what);
74+
+int lock_kernel_down(const char *where, enum lockdown_reason level);
7275
int lsm_fill_user_ctx(struct lsm_ctx __user *uctx, u32 *uctx_len,
7376
void *val, size_t val_len, u64 id, u64 flags);
74-
+int lock_kernel_down(const char *where, enum lockdown_reason level);
75-
#else /* CONFIG_SECURITY */
76-
77-
static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data)
78-
@@ -1483,6 +1484,11 @@ static inline int lsm_fill_user_ctx(struct lsm_ctx __user *uctx,
77+
int security_bdev_alloc(struct block_device *bdev);
78+
@@ -1504,6 +1505,11 @@ static inline int security_locked_down(e
7979
{
80-
return -EOPNOTSUPP;
80+
return 0;
8181
}
8282
+static inline int
8383
+lock_kernel_down(const char *where, enum lockdown_reason level)
8484
+{
8585
+ return -EOPNOTSUPP;
8686
+}
87-
#endif /* CONFIG_SECURITY */
88-
89-
#if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE)
87+
static inline int lsm_fill_user_ctx(struct lsm_ctx __user *uctx,
88+
u32 *uctx_len, void *val, size_t val_len,
89+
u64 id, u64 flags)
9090
--- a/security/lockdown/Kconfig
9191
+++ b/security/lockdown/Kconfig
9292
@@ -45,3 +45,18 @@ config LOCK_DOWN_KERNEL_FORCE_CONFIDENTI
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From bb8912cf807feab56cf8e924d33229d800ae71a6 Mon Sep 17 00:00:00 2001
21
From: Ben Hutchings <ben@decadent.org.uk>
32
Date: Fri, 30 Aug 2019 15:54:24 +0100
4-
Subject: [PATCH 3/4] mtd: phram,slram: Disable when the kernel is locked down
3+
Subject: mtd: phram,slram: Disable when the kernel is locked down
4+
Forwarded: https://lore.kernel.org/linux-security-module/20190830154720.eekfjt6c4jzvlbfz@decadent.org.uk/
55

66
These drivers allow mapping arbitrary memory ranges as MTD devices.
77
This should be disabled to preserve the kernel's integrity when it is
@@ -21,11 +21,9 @@ Cc: linux-mtd@lists.infradead.org
2121
drivers/mtd/devices/slram.c | 9 ++++++++-
2222
2 files changed, 13 insertions(+), 2 deletions(-)
2323

24-
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
25-
index 208bd4d871f4..30f84a91692d 100644
2624
--- a/drivers/mtd/devices/phram.c
2725
+++ b/drivers/mtd/devices/phram.c
28-
@@ -364,7 +364,11 @@ static int phram_param_call(const char *val, const struct kernel_param *kp)
26+
@@ -364,7 +364,11 @@ static int phram_param_call(const char *
2927
#endif
3028
}
3129

@@ -38,8 +36,6 @@ index 208bd4d871f4..30f84a91692d 100644
3836
MODULE_PARM_DESC(phram, "Memory region to map. \"phram=<name>,<start>,<length>[,<erasesize>]\"");
3937

4038
#ifdef CONFIG_OF
41-
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
42-
index 28131a127d06..d92a2461e2ce 100644
4339
--- a/drivers/mtd/devices/slram.c
4440
+++ b/drivers/mtd/devices/slram.c
4541
@@ -43,6 +43,7 @@
@@ -77,6 +73,3 @@ index 28131a127d06..d92a2461e2ce 100644
7773
while (map) {
7874
devname = devstart = devlength = NULL;
7975

80-
--
81-
2.39.2
82-

0 commit comments

Comments
 (0)