linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: "David Woodhouse" <dwmw2@infradead.org>,
	"David Howells" <dhowells@redhat.com>,
	"Andy Lutomirski" <luto@amacapital.net>,
	"Kees Cook" <keescook@chromium.org>,
	"Roberts, William C" <william.c.roberts@intel.com>,
	"linux-security-module@vger.kernel.org"
	<linux-security-module@vger.kernel.org>,
	linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
	"james.l.morris@oracle.com" <james.l.morris@oracle.com>,
	"serge@hallyn.com" <serge@hallyn.com>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>,
	"Paul Moore" <paul@paul-moore.com>,
	"Eric Paris" <eparis@parisplace.org>,
	selinux@tycho.nsa.gov, "Stephen Smalley" <sds@tycho.nsa.gov>,
	"Schaufler, Casey" <casey.schaufler@intel.com>,
	"Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	"Dmitry Kasatkin" <dmitry.kasatkin@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Peter Jones" <pjones@redhat.com>, "Takashi Iwai" <tiwai@suse.de>,
	"Ming Lei" <ming.lei@canonical.com>, "Joey Lee" <jlee@suse.de>,
	"\"Vojtěch Pavlík\"" <vojtech@suse.com>,
	"Kyle McMartin" <kyle@kernel.org>,
	"Seth Forshee" <seth.forshee@canonical.com>,
	"Matthew Garrett" <mjg59@srcf.ucam.org>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Julia Lawall" <julia.lawall@lip6.fr>
Subject: Re: Linux Firmware Signing
Date: Mon, 31 Aug 2015 10:18:55 -0400	[thread overview]
Message-ID: <1441030735.2647.70.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150829021659.GN8051@wotan.suse.de>

On Sat, 2015-08-29 at 04:16 +0200, Luis R. Rodriguez wrote:
> On Thu, Aug 27, 2015 at 07:54:33PM -0400, Mimi Zohar wrote:
> > On Thu, 2015-08-27 at 23:29 +0200, Luis R. Rodriguez wrote:
> > > On Thu, Aug 27, 2015 at 10:57:23AM -0000, David Woodhouse wrote:
> > > > > Luis R. Rodriguez <mcgrof@suse.com> wrote:

> > > > In conversation with Mimi last week she was very keen on the model where
> > > > we load modules & firmware in such a fashion that the kernel has access to
> > > > the original inode -- by passing in a fd,
> > > 
> > > Sure, so let's be specific to ensure what Mimi needs is there. I though there
> > > was work needed on modules but that seems covered and work then seems only
> > > needed for kexec and SELinux policy files (and a review of other possible file
> > > consumers in the kernel) for what you describe. 
> 
> Correct me if I'm wrong:
> 
> > At last year's LSS linux-integrity status update, I mentioned 6
> > measurement/appraisal gaps, kernel modules (linux-3.7), 
> 
> Done.
> 
> > firmware (linux-3.17), 
> 
> I'm working on it, but as far as LSMs are concerned the LSM hook
> is in place.

Right, the LSM hooks are used by LSMs, but also used by the integrity
subsystem, like here, to measure the file and verify the integrity of
the file.    

 int security_kernel_fw_from_file(struct file *file, char *buf, size_t size)
{
        int ret;

        ret = call_int_hook(kernel_fw_from_file, 0, file, buf, size);
        if (ret)
                return ret;
        return ima_fw_from_file(file, buf, size);
}

> > kexec,
> 
> I'll note kexec has both a kernel and initramfs :) so just keep that
> in mind. Technically it should vet for both. It seems we just need
> an LSM hook there.

Distros build the initramfs on the target system, so the initramfs can't
come signed.  But for those systems that the initramfs can be signed, we
should be verifying it.

> > initramfs, 
> 
> Hm, what code path?

In addition, the files within the initramfs should be measured and
verified.   There isn't a need for a new hook, but for xattr support in
CPIO.  I started adding that support last winter -
http://lwn.net/Articles/630101/ .   Others have requested other changes,
not related to xattrs, before bumping the CPIO magic number.   There
should be a discussion as to what else needs to be done.

> > eBPF/seccomp 
> 
> Same here, where's this?
> 
> > and policies,
> 
> Which ones?
> 
> >  that have
> > been or need to be addressed.  Since then, a new kexec syscall, file
> > descriptor based, was upstreamed that appraises the image.  Until we can
> > preserve the measurement list across kexec,
> 
> I'm sorry I do not follow, can you elaborate on what you mean by this.
> Its not clear to me what you mean by the measurement list. Do you mean
> all the above items?
 
A measurement is a hash of the file which is stored in the measurement
list <securityfs>/ima/ascii_runtime_measurements and is used to extend
the TPM (eg. PCR 10).   The measurement list, in conjunction with a
quote of the TPM PCRs, can be used to remotely detect whether a system
has been compromised.

David Safford's white paper "An Overview of the Linux Integrity
subsystem" -
http://downloads.sf.net/project/linux-ima/linux-ima/Integrity_overview.pdf  goes into details of the different terms and concepts. (The IMA wiki is dated.) There's also a ic2e paper titled "Scalable Attestation: a step toward secure and trusted cloud".

> > it doesn't make sense to
> > measure the image just to have it thrown away.  (skipping initramfs as
> > that isn't related to LSM hooks
> 
> Hrm, it can be, I mean at least for the kexec case its a fd that is passed
> as part of the syscall, not sure of the other case you mentioned yet
> as I haven't reviewed that code yet.

Right, in those situations that the initramfs can be signed, it should
be verified.

> >.)  Lastly, measuring/appraising policies
> > (eg. IMA, SELinux, Smack, iptables/ebtables) 
> 
> OK for each of these:
> 
> how do we load the data? 

I'm not real happy about it, but since we can't break the existing ABI
of loading data into the kernel via a buffer, a stop gap method of
signing and verifying a buffer would be needed.

> Is that the full list? Note we should
> be able to use grammar rules to hunt these down, I just haven't
> sat down to write them but if this is important well we should.
> 
> > or any other files consumed
> > by the kernel.
> 
> :D likewise

< skip >

> It'd be good for us to do a further review to really vet *all* areas.
> I am not convinced we've covered them all.

Agreed

Mimi


  reply	other threads:[~2015-08-31 14:20 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150824210234.GI8051@wotan.suse.de>
     [not found] ` <476DC76E7D1DF2438D32BFADF679FC5601057D32@ORSMSX103.amr.corp.intel.com>
     [not found]   ` <20150824225713.GJ8051@wotan.suse.de>
     [not found]     ` <CAGXu5jLDHCgygaVNHpuvszN6SXNKAjRW83q3-D2ZfRpO4uAmdw@mail.gmail.com>
     [not found]       ` <476DC76E7D1DF2438D32BFADF679FC5601058E78@ORSMSX103.amr.corp.intel.com>
     [not found]         ` <CAGXu5jJuwPfnQhu9u4-90UkmjWTBF_GLpJ7J1VaaT2D0d_-Mhg@mail.gmail.com>
     [not found]           ` <1440462367.2737.4.camel@linux.vnet.ibm.com>
     [not found]             ` <CALCETrXWBBdOKz-fSdM7YVu_sWQbA3YsHPeZAkRmtj+eawqZGQ@mail.gmail.com>
     [not found]               ` <1440464705.2737.36.camel@linux.vnet.ibm.com>
     [not found]                 ` <14540.1440599584@warthog.procyon.org.uk>
2015-08-26 23:26                   ` Linux Firmware Signing Luis R. Rodriguez
2015-08-27  2:35                     ` Paul Moore
2015-08-27 19:36                       ` Luis R. Rodriguez
2015-08-27 23:46                         ` Paul Moore
2015-08-27 10:38                     ` David Howells
2015-08-27 10:57                       ` David Woodhouse
2015-08-27 21:29                         ` Luis R. Rodriguez
2015-08-27 23:54                           ` Mimi Zohar
2015-08-29  2:16                             ` Luis R. Rodriguez
2015-08-31 14:18                               ` Mimi Zohar [this message]
2015-08-31 16:05                                 ` David Woodhouse
2015-08-31 16:45                                   ` Mimi Zohar
2015-09-02  0:00                                     ` Luis R. Rodriguez
2015-09-01 23:43                                 ` Luis R. Rodriguez
2015-09-02  3:08                                   ` Kees Cook
2015-09-02  3:44                                     ` Mimi Zohar
2015-09-02 15:28                                       ` Kees Cook
2015-09-02 16:45                                         ` Mimi Zohar
2015-09-02 17:36                                           ` Austin S Hemmelgarn
2015-09-02 23:54                                   ` Mimi Zohar
2015-09-03  0:18                                     ` Luis R. Rodriguez
2015-08-27 23:56                           ` Paul Moore
2015-08-28 11:20                             ` Roberts, William C
2015-08-28 22:26                               ` Paul Moore
2015-08-29  2:03                                 ` Luis R. Rodriguez
2015-09-01  2:52                                   ` Paul Moore
2015-09-01 14:12                                     ` Joshua Brindle
2015-09-01 20:08                                       ` Roberts, William C
2015-09-01 20:46                                         ` Joshua Brindle
2015-09-01 22:21                                     ` Eric Paris
2015-08-29  1:56                               ` Luis R. Rodriguez
2015-09-01 20:20                           ` Kees Cook
2015-09-02  0:09                             ` Luis R. Rodriguez
2015-09-02  3:35                               ` Mimi Zohar
2015-09-02 18:46                                 ` Luis R. Rodriguez
2015-09-02 20:54                                   ` Kees Cook
2015-09-02 21:37                                     ` Luis R. Rodriguez
2015-09-03 21:14                                       ` Kees Cook
2015-09-30 20:34                                         ` Luis R. Rodriguez
2015-09-03  0:05                                   ` Mimi Zohar
2015-09-03  0:29                                     ` Luis R. Rodriguez
2015-09-03  3:00                                       ` Mimi Zohar
2015-08-27 19:37                       ` Luis R. Rodriguez

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=1441030735.2647.70.camel@linux.vnet.ibm.com \
    --to=zohar@linux.vnet.ibm.com \
    --cc=casey.schaufler@intel.com \
    --cc=dhowells@redhat.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=eparis@parisplace.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=james.l.morris@oracle.com \
    --cc=jlee@suse.de \
    --cc=johannes@sipsolutions.net \
    --cc=julia.lawall@lip6.fr \
    --cc=keescook@chromium.org \
    --cc=kyle@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mcgrof@do-not-panic.com \
    --cc=mcgrof@suse.com \
    --cc=ming.lei@canonical.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=paul@paul-moore.com \
    --cc=pjones@redhat.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=serge@hallyn.com \
    --cc=seth.forshee@canonical.com \
    --cc=tiwai@suse.de \
    --cc=vkuznets@redhat.com \
    --cc=vojtech@suse.com \
    --cc=william.c.roberts@intel.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;
as well as URLs for NNTP newsgroup(s).