linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] module: Do not access sig_enforce directly
@ 2018-04-11  3:53 Jia Zhang
  2018-04-11  3:53 ` [PATCH 2/2] module: Allow to always show the status of modsign Jia Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Jia Zhang @ 2018-04-11  3:53 UTC (permalink / raw)
  To: jeyu; +Cc: linux-kernel, zhang.jia

Call is_module_sig_enforced() instead.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
---
 kernel/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/module.c b/kernel/module.c
index a6e43a5..f695474 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2785,7 +2785,7 @@ static int module_sig_check(struct load_info *info, int flags)
 	}
 
 	/* Not having a signature is only an error if we're strict. */
-	if (err == -ENOKEY && !sig_enforce)
+	if (err == -ENOKEY && !is_module_sig_enforced())
 		err = 0;
 
 	return err;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] module: Allow to always show the status of modsign
  2018-04-11  3:53 [PATCH 1/2] module: Do not access sig_enforce directly Jia Zhang
@ 2018-04-11  3:53 ` Jia Zhang
  2018-04-16 15:51   ` Jessica Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Jia Zhang @ 2018-04-11  3:53 UTC (permalink / raw)
  To: jeyu; +Cc: linux-kernel, zhang.jia

The sig_enforce parameter could be always shown to reflect the
current status of modsign. For the case of CONFIG_MODULE_SIG_FORCE=y,
this modification does nothing harmless.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
---
 kernel/module.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index f695474..1e3337b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -274,9 +274,7 @@ static void module_assert_mutex_or_preempt(void)
 }
 
 static bool sig_enforce = IS_ENABLED(CONFIG_MODULE_SIG_FORCE);
-#ifndef CONFIG_MODULE_SIG_FORCE
 module_param(sig_enforce, bool_enable_only, 0644);
-#endif /* !CONFIG_MODULE_SIG_FORCE */
 
 /*
  * Export sig_enforce kernel cmdline parameter to allow other subsystems rely
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] module: Allow to always show the status of modsign
  2018-04-11  3:53 ` [PATCH 2/2] module: Allow to always show the status of modsign Jia Zhang
@ 2018-04-16 15:51   ` Jessica Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Jessica Yu @ 2018-04-16 15:51 UTC (permalink / raw)
  To: Jia Zhang; +Cc: linux-kernel

+++ Jia Zhang [11/04/18 11:53 +0800]:
>The sig_enforce parameter could be always shown to reflect the
>current status of modsign. For the case of CONFIG_MODULE_SIG_FORCE=y,
>this modification does nothing harmless.
>
>Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>

Both patches look fine to me. Queued on modules-next.

Thanks,

Jessica

>---
> kernel/module.c | 2 --
> 1 file changed, 2 deletions(-)
>
>diff --git a/kernel/module.c b/kernel/module.c
>index f695474..1e3337b 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -274,9 +274,7 @@ static void module_assert_mutex_or_preempt(void)
> }
>
> static bool sig_enforce = IS_ENABLED(CONFIG_MODULE_SIG_FORCE);
>-#ifndef CONFIG_MODULE_SIG_FORCE
> module_param(sig_enforce, bool_enable_only, 0644);
>-#endif /* !CONFIG_MODULE_SIG_FORCE */
>
> /*
>  * Export sig_enforce kernel cmdline parameter to allow other subsystems rely
>-- 
>1.8.3.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-16 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11  3:53 [PATCH 1/2] module: Do not access sig_enforce directly Jia Zhang
2018-04-11  3:53 ` [PATCH 2/2] module: Allow to always show the status of modsign Jia Zhang
2018-04-16 15:51   ` Jessica Yu

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).