* [PATCH 1/2] module: export sig_enforce readonly even if MODULE_SIG_FORCE is on
@ 2013-11-05 0:06 Eric Miao
2013-11-05 0:06 ` [PATCH 2/2] MODSIG: use pre-generated X.509 key by MODPUBKEY Eric Miao
0 siblings, 1 reply; 2+ messages in thread
From: Eric Miao @ 2013-11-05 0:06 UTC (permalink / raw)
To: linux-kernel; +Cc: Eric Miao, David Howells, Dan Willemsen
Even if MODULE_SIG_FORCE is turned on, it is still useful if module
can export sig_enforce, so user space will know if module signature
is turned on and forced.
Signed-off-by: Eric Miao <eric.miao@nvidia.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Dan Willemsen <dwillemsen@nvidia.com>
---
kernel/module.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kernel/module.c b/kernel/module.c
index dc58274..d55646b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -110,6 +110,14 @@ struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */
#ifdef CONFIG_MODULE_SIG
#ifdef CONFIG_MODULE_SIG_FORCE
static bool sig_enforce = true;
+
+static const struct kernel_param_ops param_ops_bool_read_only = {
+ .flags = KERNEL_PARAM_FL_NOARG,
+ .get = param_get_bool,
+};
+#define param_check_bool_read_only param_check_bool
+
+module_param(sig_enforce, bool_read_only, 0444);
#else
static bool sig_enforce = false;
--
1.8.4.1
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH 2/2] MODSIG: use pre-generated X.509 key by MODPUBKEY
2013-11-05 0:06 [PATCH 1/2] module: export sig_enforce readonly even if MODULE_SIG_FORCE is on Eric Miao
@ 2013-11-05 0:06 ` Eric Miao
0 siblings, 0 replies; 2+ messages in thread
From: Eric Miao @ 2013-11-05 0:06 UTC (permalink / raw)
To: linux-kernel; +Cc: Eric Miao, David Howells, Dan Willemsen
If MODPUBKEY is specified and other than default ./signing_key.x509, use
that key instead of generating one on-the-fly.
Signed-off-by: Eric Miao <eric.miao@nvidia.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Dan Willemsen <dwillemsen@nvidia.com>
---
kernel/Makefile | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kernel/Makefile b/kernel/Makefile
index 1ce4755..66c7c32 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -165,6 +165,13 @@ ifndef CONFIG_MODULE_SIG_HASH
$(error Could not determine digest type to use from kernel config)
endif
+ifneq ($(MODPUBKEY),./signing_key.x509)
+signing_key.x509: $(MODPUBKEY)
+ @echo "###"
+ @echo "### Use pre-generated X.509 key pair for signing modules."
+ @echo "###"
+ cp -f $< $@
+else
signing_key.priv signing_key.x509: x509.genkey
@echo "###"
@echo "### Now generating an X.509 key pair to be used for signing modules."
@@ -202,3 +209,4 @@ x509.genkey:
@echo >>x509.genkey "subjectKeyIdentifier=hash"
@echo >>x509.genkey "authorityKeyIdentifier=keyid"
endif
+endif
--
1.8.4.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-05 0:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-05 0:06 [PATCH 1/2] module: export sig_enforce readonly even if MODULE_SIG_FORCE is on Eric Miao
2013-11-05 0:06 ` [PATCH 2/2] MODSIG: use pre-generated X.509 key by MODPUBKEY Eric Miao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®