[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1378622648.2300.4.camel@x230>
Date: Sun, 8 Sep 2013 06:44:08 +0000
From: Matthew Garrett <matthew.garrett@...ula.com>
To: Greg KH <gregkh@...uxfoundation.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
"keescook@...omium.org" <keescook@...omium.org>,
"hpa@...or.com" <hpa@...or.com>
Subject: Re: [PATCH V3 08/11] kexec: Disable at runtime if the kernel
enforces module loading restrictions
On Sat, 2013-09-07 at 23:40 -0700, Greg KH wrote:
> On Tue, Sep 03, 2013 at 07:50:15PM -0400, Matthew Garrett wrote:
> > kexec permits the loading and execution of arbitrary code in ring 0, which
> > is something that module signing enforcement is meant to prevent. It makes
> > sense to disable kexec in this situation.
>
> I see no match between kexec and signed kernel modules.
sig_enforce is there to prevent anyone (including root) from installing
new kernel code in the running kernel. Allowing kexec to run untrusted
code allows root to install new kernel code in the running kernel. At
the most trivial level, grab the address of sig_enforce from kallsyms,
jump to a kernel that doesn't enforce STRICT_DEVMEM, modify sig_enforce,
jump back to the old kernel.
> In fact, I personally _want_ signed kernel modules, and still the option
> to run kexec. kexec is to run a whole new kernel/OS, not a tiny kernel
> module.
No, kexec is to run anything. It's expressly not limited to launching
new kernels. It's easiest to demonstrate an attack using a Linux kernel,
but you could launch a toy payload that did nothing other than modify
one byte and then returned to the launch kernel.
> If you apply this, you break everyone who is currently relying on kexec
> (i.e. kdump, bootloaders, etc.), from using signed kernel modules, which
> personally, seems like a very bad idea.
Enforcing signed modules provides you with no additional security if you
have kexec enabled. It's better to make that obvious.
--
Matthew Garrett <matthew.garrett@...ula.com>
Powered by blists - more mailing lists