* [PATCH v2] module: Allow to disable modsign in kernel cmdline
@ 2020-04-28 5:05 Tianjia Zhang
2020-04-28 5:52 ` Randy Dunlap
0 siblings, 1 reply; 3+ messages in thread
From: Tianjia Zhang @ 2020-04-28 5:05 UTC (permalink / raw)
To: jeyu, corbet, rdunlap, mchehab+samsung, tglx, akpm, gregkh,
pawan.kumar.gupta, jgross
Cc: linux-kernel, linux-doc, tianjia.zhang
This option allows to disable modsign completely at the beginning,
and turn off by set the kernel cmdline `no_modsig_enforce` when
`CONFIG_MODULE_SIG_FORCE` is enabled.
Yet another change allows to always show the current status of
modsign through `/sys/module/module/parameters/sig_enforce`.
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
Documentation/admin-guide/kernel-parameters.txt | 6 ++++++
kernel/module.c | 8 ++++++++
2 files changed, 14 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 7bc83f3d9bdf..00ed7566959f 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3190,6 +3190,12 @@
noirqdebug [X86-32] Disables the code which attempts to detect and
disable unhandled interrupt sources.
+ no_modsig_enforce
+ [KNL] When CONFIG_MODULE_SIG_FORCE is set, this option
+ allows to disable modsign completely at the beginning.
+ This means that modules without (valid) signatures will
+ success to load.
+
no_timer_check [X86,APIC] Disables the code which tests for
broken timer IRQ sources.
diff --git a/kernel/module.c b/kernel/module.c
index 646f1e2330d2..0e68e1286377 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -269,6 +269,14 @@ static void module_assert_mutex_or_preempt(void)
static bool sig_enforce = IS_ENABLED(CONFIG_MODULE_SIG_FORCE);
module_param(sig_enforce, bool_enable_only, 0644);
+#ifdef CONFIG_MODULE_SIG_FORCE
+static int __init set_no_modsig_enforce(char *str)
+{
+ sig_enforce = false;
+ return 1;
+}
+__setup("no_modsig_enforce", set_no_modsig_enforce);
+#endif /* !CONFIG_MODULE_SIG_FORCE */
/*
* Export sig_enforce kernel cmdline parameter to allow other subsystems rely
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] module: Allow to disable modsign in kernel cmdline
2020-04-28 5:05 [PATCH v2] module: Allow to disable modsign in kernel cmdline Tianjia Zhang
@ 2020-04-28 5:52 ` Randy Dunlap
2020-04-28 6:01 ` Tianjia Zhang
0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2020-04-28 5:52 UTC (permalink / raw)
To: Tianjia Zhang, jeyu, corbet, mchehab+samsung, tglx, akpm, gregkh,
pawan.kumar.gupta, jgross
Cc: linux-kernel, linux-doc
Hi,
On 4/27/20 10:05 PM, Tianjia Zhang wrote:
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 7bc83f3d9bdf..00ed7566959f 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -3190,6 +3190,12 @@
> noirqdebug [X86-32] Disables the code which attempts to detect and
> disable unhandled interrupt sources.
>
> + no_modsig_enforce
> + [KNL] When CONFIG_MODULE_SIG_FORCE is set, this option
> + allows to disable modsign completely at the beginning.
> + This means that modules without (valid) signatures will
> + success to load.
succeed to load.
succeed in loading.
load successfully.
I prefer this one..... ^^^^^^^^^^^^^^^^^^^^^
be loaded successfully.
> +
> no_timer_check [X86,APIC] Disables the code which tests for
> broken timer IRQ sources.
>
thanks.
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] module: Allow to disable modsign in kernel cmdline
2020-04-28 5:52 ` Randy Dunlap
@ 2020-04-28 6:01 ` Tianjia Zhang
0 siblings, 0 replies; 3+ messages in thread
From: Tianjia Zhang @ 2020-04-28 6:01 UTC (permalink / raw)
To: Randy Dunlap, jeyu, corbet, mchehab+samsung, tglx, akpm, gregkh,
pawan.kumar.gupta, jgross
Cc: linux-kernel, linux-doc
On 2020/4/28 13:52, Randy Dunlap wrote:
> Hi,
>
> On 4/27/20 10:05 PM, Tianjia Zhang wrote:
>> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
>> index 7bc83f3d9bdf..00ed7566959f 100644
>> --- a/Documentation/admin-guide/kernel-parameters.txt
>> +++ b/Documentation/admin-guide/kernel-parameters.txt
>> @@ -3190,6 +3190,12 @@
>> noirqdebug [X86-32] Disables the code which attempts to detect and
>> disable unhandled interrupt sources.
>>
>> + no_modsig_enforce
>> + [KNL] When CONFIG_MODULE_SIG_FORCE is set, this option
>> + allows to disable modsign completely at the beginning.
>> + This means that modules without (valid) signatures will
>> + success to load.
>
> succeed to load.
>
> succeed in loading.
>
> load successfully.
> I prefer this one..... ^^^^^^^^^^^^^^^^^^^^^
>
> be loaded successfully.
>
>
>> +
>> no_timer_check [X86,APIC] Disables the code which tests for
>> broken timer IRQ sources.
>>
>
> thanks.
>
v3 patch has been submitted, thank you for your suggestion.
Thanks,
Tianjia
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-28 6:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 5:05 [PATCH v2] module: Allow to disable modsign in kernel cmdline Tianjia Zhang
2020-04-28 5:52 ` Randy Dunlap
2020-04-28 6:01 ` Tianjia Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).