Enforce module signatures if the kernel is locked down
authorDavid Howells <dhowells@redhat.com>
Wed, 5 Apr 2017 16:40:30 +0000 (17:40 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 12 Aug 2017 22:09:26 +0000 (23:09 +0100)
If the kernel is locked down, require that all modules have valid
signatures that we can verify.

Signed-off-by: David Howells <dhowells@redhat.com>
Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name 0041-Enforce-module-signatures-if-the-kernel-is-locked-do.patch

kernel/module.c

index 4a3665f8f8372aab68b658c24c30678806823eee..3f1de34c6d10f55bb801797884c7df73b2ae0a9c 100644 (file)
@@ -2777,7 +2777,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 && !sig_enforce && !kernel_is_locked_down())
                err = 0;
 
        return err;