lkml.org 
[lkml]   [2012]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 23/23] MODSIGN: Panic the kernel if FIPS is enabled upon module signing failure
Date
If module signing fails when the kernel is running with FIPS enabled then the
kernel should panic lest the crypto layer be compromised. Possibly a panic
shouldn't happen on cases like ENOMEM.

Reported-by: Stephan Mueller <stephan.mueller@atsec.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

kernel/module-verify.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/kernel/module-verify.c b/kernel/module-verify.c
index f989fee..9baecc6 100644
--- a/kernel/module-verify.c
+++ b/kernel/module-verify.c
@@ -19,6 +19,7 @@
#include <linux/sched.h>
#include <linux/modsign.h>
#include <linux/moduleparam.h>
+#include <linux/fips.h>
#include <keys/crypto-type.h>
#include "module-verify.h"

@@ -109,6 +110,10 @@ int module_verify(const void *data, size_t size, bool *_gpgsig_ok)

pr_devel("module_verify_signature() = %d\n", ret);

+ if (ret < 0 && fips_enabled)
+ panic("Module verification failed with error %d in FIPS mode\n",
+ ret);
+
switch (ret) {
case 0: /* Good signature */
*_gpgsig_ok = true;


\
 
 \ /
  Last update: 2012-05-23 01:41    [W:0.227 / U:4.376 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site