linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
Cc: Matthew Garrett
	<matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>,
	Mimi Zohar
	<zohar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	James Morris <jmorris-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
Date: Thu, 21 Mar 2013 13:15:56 -0400	[thread overview]
Message-ID: <20130321171556.GM3934@redhat.com> (raw)
In-Reply-To: <20130321161952.GA4957-anj0Drq5vpzx6HRWoRZK3AC/G2K4zDHf@public.gmane.org>

On Thu, Mar 21, 2013 at 11:19:52AM -0500, Serge E. Hallyn wrote:

[..]
> > I am hoping I did not miss your point entirely.
> 
> No, you didn't.  If replay attacks are not a concern then that bit
> doesn't matter.  But if^Wwhen there is a vulnerability in a signed kernel,
> and a user has a copy of bzImage sitting around, signed kexec alone does
> not suffice (and I'm assuming revocation is not going into the kernel?).
> It seems to me if replay attacks are ignored, this is all for theater...
> 

As matthew mentioned, revocation list is in kernel. So old vulnerable
kernels should fail signature verification.

> The other concern is analogous, just more general - seems like I may very
> well be able to find a way to corrupt kexec or even corrupt the kernel with
> a bad environment.
> 
> So I'm just saying that in general it doesn't seem worth having a special
> list of capabilities that only signed executables can have, without doing 
> something about the environment.

Agreed that only being signed is part of the problem. Environment is
important too. And running signed binaries memory locked is I think
one part of controlling the environment. But there might be other
things too which I am blissfully unaware of.

Right now there were few things we were considering for controlling
the environemnt.

- Build /sbin/kexec statically and sign only statically linked exeutables.
- Run executables memory locked
- Unsigned binary can not ptrace() signed one.

> And that the solution to that seems like
> what we can already do today (with a bounding set and init-launched
> services).

Frankly speaking I did not understand this part. For secureboot issue
we don't trust root and don't trust init. I am assuming any restricted
environment setup will have to be done by a trusted entity.
 
> 
> All of this is probably premature though.  IIUC the first thing you are
> after is a way to record on the file the fact that it is a verified-signature
> binary, and that's what CAP_SIGNED meant right?

Yes, that was the first thing. How to reliably sign and verify signature
of a executable. Also make sure executable code/data can not modified
in memory later by anything untrusted.

>   I agree we need something
> like that, but using a capability is not right.  You can add a field to
> the binprm or file or f_cred, or even add a field to the capability struct,
> meaningful only on files, to show it was signed - but not taint the list of
> capabilities with something that is not a capability. 

Ok, I will look into other options too. Agreed being signed is not a
capability. But being signed along with other attributes should allow to 
get one a capability (CAP_MODIFY_KERNEL in this case). I am not sure why
nobody likes that idea. But that's fine, I will go with advice of subject
matter experts.

> I haven't looked
> closer to see which would be the best way (my hunch would be binprm), will 
> be happy to come up with a proposal when I have time, but I don't want to slow
> you down :)

Any suggetions are greatly appreciated whenever time permits. In the mean
time I will atleast write more code and post it for RFC and hopefully
there will be some consensus on how to solve kexec issue.

Thanks
Vivek

  parent reply	other threads:[~2013-03-21 17:15 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 21:32 [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL Matthew Garrett
2013-03-18 21:32 ` [PATCH 03/12] Secure boot: Add a dummy kernel parameter that will switch on Secure Boot mode Matthew Garrett
2013-03-18 21:32 ` [PATCH 05/12] PCI: Require CAP_COMPROMISE_KERNEL for PCI BAR access Matthew Garrett
2013-03-27 15:03   ` Josh Boyer
2013-03-27 15:08     ` Kyle McMartin
2013-03-28 12:46       ` Josh Boyer
2013-03-18 21:32 ` [PATCH 06/12] x86: Require CAP_COMPROMISE_KERNEL for IO port access Matthew Garrett
2013-03-20  1:00   ` H. Peter Anvin
2013-03-18 21:32 ` [PATCH 08/12] asus-wmi: Restrict debugfs interface Matthew Garrett
2013-03-18 21:32 ` [PATCH 09/12] Require CAP_COMPROMISE_KERNEL for /dev/mem and /dev/kmem access Matthew Garrett
     [not found] ` <1363642353-30749-1-git-send-email-matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>
2013-03-18 21:32   ` [PATCH 02/12] SELinux: define mapping for CAP_COMPROMISE_KERNEL Matthew Garrett
2013-03-18 21:32   ` [PATCH 04/12] efi: Enable secure boot lockdown automatically when enabled in firmware Matthew Garrett
2013-03-18 21:32   ` [PATCH 07/12] ACPI: Limit access to custom_method Matthew Garrett
2013-03-18 21:32   ` [PATCH 10/12] acpi: Ignore acpi_rsdp kernel parameter in a secure boot environment Matthew Garrett
     [not found]     ` <1363642353-30749-10-git-send-email-matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org>
2013-03-19  8:47       ` Dave Young
     [not found]         ` <5148261F.3030806-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-19 11:19           ` Josh Boyer
2013-03-19 17:07             ` [PATCH v2] " Josh Boyer
2013-03-18 21:32   ` [PATCH 11/12] x86: Require CAP_COMPROMISE_KERNEL for MSR writing Matthew Garrett
2013-03-18 21:32   ` [PATCH 12/12] kexec: Require CAP_SYS_COMPROMISE_KERNEL Matthew Garrett
2013-03-19  4:47   ` [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL James Morris
2013-03-20  1:03     ` H. Peter Anvin
2013-03-20 16:41     ` Mimi Zohar
2013-03-20 16:49       ` Matthew Garrett
2013-03-20 18:01         ` Mimi Zohar
2013-03-20 18:12           ` Matthew Garrett
     [not found]             ` <1363803158.2553.33.camel-tCUS0Eywp2Pehftex57rkxo58HMYffqeLoYNBG0abjxeoWH0uzbU5w@public.gmane.org>
2013-03-20 19:16               ` Mimi Zohar
     [not found]                 ` <1363806968.2580.86.camel-T0Mscta5zSJpk64qw6wm7cxtgHpCUUYS@public.gmane.org>
2013-03-20 20:37                   ` Matthew Garrett
2013-03-20 21:11                     ` Mimi Zohar
2013-03-20 21:18                       ` Matthew Garrett
     [not found]                         ` <1363814289.2553.41.camel-tCUS0Eywp2Pehftex57rkxo58HMYffqeLoYNBG0abjxeoWH0uzbU5w@public.gmane.org>
2013-03-21 13:43                           ` Vivek Goyal
     [not found]                             ` <20130321134348.GA3934-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-21 15:37                               ` Serge E. Hallyn
     [not found]                                 ` <20130321153725.GA3656-anj0Drq5vpzx6HRWoRZK3AC/G2K4zDHf@public.gmane.org>
2013-03-21 15:52                                   ` Vivek Goyal
     [not found]                                     ` <20130321155220.GL3934-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-21 15:58                                       ` Serge E. Hallyn
2013-03-21 16:04                                         ` Vivek Goyal
     [not found]                                           ` <20130321160441.GB6575-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-21 16:19                                             ` Serge E. Hallyn
     [not found]                                               ` <20130321161952.GA4957-anj0Drq5vpzx6HRWoRZK3AC/G2K4zDHf@public.gmane.org>
2013-03-21 17:15                                                 ` Vivek Goyal [this message]
2013-03-21  1:58       ` James Morris
2013-03-19  7:18 ` Yves-Alexis Perez
2013-03-20  1:02 ` H. Peter Anvin
2013-03-20  1:05   ` H. Peter Anvin
     [not found]   ` <51490ABD.3050205-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-03-20 13:15     ` Matthew Garrett
     [not found]       ` <1363785354.2553.15.camel-tCUS0Eywp2Pehftex57rkxo58HMYffqeLoYNBG0abjxeoWH0uzbU5w@public.gmane.org>
2013-03-20 15:03         ` H. Peter Anvin
     [not found]           ` <db71c48c-4ec4-4611-935b-bb1b0441112d-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2013-03-20 15:14             ` Matthew Garrett
2013-03-20 16:45               ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2013-03-20  1:07 Matthew Garrett
     [not found] ` <k1r3u75sumyfkayvoobjrce1.1363741640644-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2013-03-20  1:11   ` H. Peter Anvin
2013-03-20  1:09 Matthew Garrett
2013-03-20  1:28 Matthew Garrett
2013-03-20  2:48 ` H. Peter Anvin
     [not found]   ` <51492379.3090302-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-03-20  3:08     ` H. Peter Anvin
     [not found]       ` <51492828.5070803-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-03-20  3:18         ` Alex Williamson
     [not found]           ` <1363749503.24132.482.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-03-20  3:22             ` H. Peter Anvin
     [not found]               ` <51492B78.7020404-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-03-20  3:27                 ` Alex Williamson
2013-03-21 16:32 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=20130321171556.GM3934@redhat.com \
    --to=vgoyal-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=jmorris-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org \
    --cc=kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org \
    --cc=serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org \
    --cc=zohar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).