All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] modsign enhancement
@ 2018-03-08  4:26 Jia Zhang
  2018-03-08  4:27 ` [PATCH 1/4] module: Do not access sig_enforce directly Jia Zhang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jia Zhang @ 2018-03-08  4:26 UTC (permalink / raw)
  To: jeyu; +Cc: linux-kernel, zhang.jia

This patch series allows to disable module validity enforcement
in runtime through /sys/kernel/security/modsign/enforce interface.

Assuming CONFIG_MODULE_SIG_FORCE=y, here are the instructions to
disable the validity enforcement.

# cat /sys/kernel/security/modsign/enforce
# echo -n 0 > data
# openssl smime -sign -nocerts -noattr -binary -in data \
    -inkey <system_trusted_key> -signer <cert> -outform der \
    -out /sys/kernel/security/modsign/enforce

Now enable enforcement again on demand.

# echo 1 > /sys/kernel/security/modsign/enforce

Changelog:
v2:
- Support to disable validity enforcement in runtime.

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH 1/4] module: Do not access sig_enforce directly
@ 2018-03-01  9:09 Jia Zhang
  2018-03-01  9:09 ` [PATCH 2/4] module: Create the entry point initialize_module() Jia Zhang
  0 siblings, 1 reply; 8+ messages in thread
From: Jia Zhang @ 2018-03-01  9:09 UTC (permalink / raw)
  To: jeyu; +Cc: zhang.jia, linux-kernel

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 ad2d420..003d0ab 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2789,7 +2789,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] 8+ messages in thread

end of thread, other threads:[~2018-03-12 14:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08  4:26 [PATCH v2 0/4] modsign enhancement Jia Zhang
2018-03-08  4:27 ` [PATCH 1/4] module: Do not access sig_enforce directly Jia Zhang
2018-03-08  4:27 ` [PATCH 2/4] module: Create the entry point initialize_module() Jia Zhang
2018-03-08  4:27 ` [PATCH 3/4] module: Support to show the current enforcement policy Jia Zhang
2018-03-08  4:27 ` [PATCH 4/4] module: Support to disable validity enforcement in runtime Jia Zhang
2018-03-12 13:28 ` [PATCH v2 0/4] modsign enhancement Jessica Yu
2018-03-12 14:15   ` Jia Zhang
  -- strict thread matches above, loose matches on Subject: below --
2018-03-01  9:09 [PATCH 1/4] module: Do not access sig_enforce directly Jia Zhang
2018-03-01  9:09 ` [PATCH 2/4] module: Create the entry point initialize_module() Jia Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.