1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-13 19:29:53 +03:00
aports/testing/linux-stable/0003-kexec-add-kexec_load_disabled-boot-option.patch
fossdd c5d7d46418 testing/linux-stable: new aport
Kernel aport with an identical config of main/linux-lts following stable
kernel releases.

community/linux-edge has been known in the past years to have a different
config and APKBUILD than linux-lts, notably some security features are
disabled to avoid a larger kernel size.

Ref: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/75307#note_467911
2025-05-04 20:07:56 +00:00

36 lines
1.1 KiB
Diff

From bca0b26f4322e5262da0fcb876f2dec7efd301be Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 14 Jul 2022 13:23:51 +0200
Subject: [PATCH 3/5] kexec: add kexec_load_disabled boot option
Make kexec_load disabled by default and add a boot option to enable it:
kexec_load_disabled=0
---
kernel/kexec_core.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index c0caa14880c3..e3af6628f098 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -885,7 +885,16 @@ static struct kexec_load_limit load_limit_panic = {
struct kimage *kexec_image;
struct kimage *kexec_crash_image;
-static int kexec_load_disabled;
+static int kexec_load_disabled = 1;
+
+static int __init kexec_load_disabled_setup(char *str)
+{
+ unsigned long disabled;
+ if (!kstrtoul(str, 0, &disabled))
+ kexec_load_disabled = disabled ? 1 : 0;
+ return 1;
+}
+__setup("kexec_load_disabled=", kexec_load_disabled_setup);
#ifdef CONFIG_SYSCTL
static int kexec_limit_handler(const struct ctl_table *table, int write,
--
2.47.1