public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Garrett <matthew.garrett@nebula.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: "kexec@lists.infradead.org" <kexec@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kexec: Disable at runtime if the kernel enforces module signing
Date: Fri, 9 Aug 2013 15:07:13 +0000	[thread overview]
Message-ID: <1376060830.2021.12.camel@x230> (raw)
In-Reply-To: <20130809110200.GA9631@redhat.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1625 bytes --]

On Fri, 2013-08-09 at 07:02 -0400, Vivek Goyal wrote:
> On Fri, Aug 09, 2013 at 03:36:37AM -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.
> > 
> 
> But in the process we wipe out running kernel's context and boot into a new
> kernel. So how different it is than root booting a new kernel through BIOS
> which does not enforce module signing.

What wipes the current kernel's context? KEXEC_JUMP is explicitly
designed to allow you to hop back and forth, but even without it you
should be able to reconstruct the original context. And there's no need
to boot a new kernel, either. All the attacker needs is the physical
address of the sig_enforce boolean, and then they launch a simple kexec
payload that simply flips that back and returns to the original kernel -
it's not like kexec limits you to booting Linux.

> Also it would be nice if we introduce new features, then we make other
> features work with those new features instead of disabling existing
> features and leave it to other people to make them work.

Sure, it'd be nice if security features got introduced with
consideration to other kernel features that allow them to be
circumvented, but this approach seems better than making them
incompatible at the Kconfig level.

-- 
Matthew Garrett | mjg59@srcf.ucam.org
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2013-08-09 15:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09  7:36 [PATCH] kexec: Disable at runtime if the kernel enforces module signing Matthew Garrett
2013-08-09 11:02 ` Vivek Goyal
2013-08-09 15:07   ` Matthew Garrett [this message]
2013-08-09 15:24     ` Vivek Goyal
2013-08-09 15:32     ` Vivek Goyal
2013-08-09 15:35     ` Vivek Goyal
2013-08-09 16:11       ` Matthew Garrett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376060830.2021.12.camel@x230 \
    --to=matthew.garrett@nebula.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox