lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Feb 2018 14:21:53 +0000
From:   David Howells <dhowells@...hat.com>
To:     linux-security-module@...r.kernel.org
Cc:     dhowells@...hat.com, gnomes@...rguk.ukuu.org.uk,
        linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org,
        jforbes@...hat.com
Subject: Re: [PATCH 08/30] kexec_file: Restrict at runtime if the kernel is locked down

David Howells <dhowells@...hat.com> wrote:

> I'm intending on inserting the attached patch before this one.

And replacing this patch with the attached.

David
---
commit ed0424c531d7dd25adebdec0ee6a78a5784f207a
Author: David Howells <dhowells@...hat.com>
Date:   Thu Feb 22 14:01:49 2018 +0000

    kexec_file: Restrict at runtime if the kernel is locked down
    
    When KEXEC_VERIFY_SIG is not enabled, kernel should not load images through
    kexec_file systemcall if the kernel is locked down unless IMA can be used
    to validate the image.
    
    [Modified by David Howells to fit with modifications to the previous patch
     and to return -EPERM if the kernel is locked down for consistency with
     other lockdowns]
    
    Signed-off-by: Jiri Bohac <jbohac@...e.cz>
    Signed-off-by: David Howells <dhowells@...hat.com>
    Cc: Matthew Garrett <mjg59@...f.ucam.org>
    cc: Chun-Yi Lee <jlee@...e.com>
    cc: kexec@...ts.infradead.org

diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index d5931e392050..c47c4de604cd 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -167,6 +167,14 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd,
 		}
 
 		ret = 0;
+		if (is_ima_appraise_enabled())
+			break;
+
+		if (kernel_is_locked_down(reason)) {
+			ret = -EPERM;
+			goto out;
+		}
+
 		break;
 
 		/* All other errors are fatal, including nomem, unparseable

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ