public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Vivek Goyal <vgoyal@redhat.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au,
	"H. Peter Anvin" <hpa@zytor.com>,
	Khalid Aziz <khalid@gonehiking.org>,
	Dave Young <dyoung@redhat.com>, Matthew Garrett <mjg@redhat.com>
Subject: Re: [RFC] Kdump with UEFI secure boot (Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting)
Date: Tue, 23 Oct 2012 08:51:53 -0700	[thread overview]
Message-ID: <87hapl6vae.fsf@xmission.com> (raw)
In-Reply-To: <20121023131854.GA16496@redhat.com> (Vivek Goyal's message of "Tue, 23 Oct 2012 09:18:54 -0400")

Vivek Goyal <vgoyal@redhat.com> writes:

> On Mon, Oct 22, 2012 at 02:07:56PM -0700, Eric W. Biederman wrote:
>
> [..]
>> > Can we pass all argument in one kexec segment and let associated image
>> > format handlers parse the arguments.
>> 
>> The issue is can we pass trusted arguments?  Any kind of firmware
>> callback ACPI, EFI, openfirmware etc needs to be in the trusted
>> parameter set so it must come from a trusted location.
>> 
>
> I think parameters will include something like read only one and second
> kernel should be able to verify it. It should not be an executable code
> of any form. (like acpi_rsdp).  I think this is similar to that we don't
> sign/verify kernel command line passed in a bootloader. 

I wasn't talking about the kernel command line.

>> Unless we can trust the /sbin/kexec binary we can't trust pointers
>> to executable code passed to us that we can not verify are safe.
>
> Given the fact we allow user to specify command line, even if we sign
> /sbin/kexec, we have no way to trust it. IMO here we just need to make
> sure that input parameters/arguments can't lead one to execute arbitrary
> code.

The x86 kernel boot protocol specifies a parameter block where the
address of the initrd etc is passed.  If we don't pass the acpi
parameter block via the command line it will come in that parameter
block.  How shrug.

>> >> There are 3 options for trusting /sbin/kexec.  There are IMA and EMA,
>> >> and it is conceivable to have ELF note sections with signatures for
>> >> executables.
>> >
>> > Can you please tell more about what is EMA and IMA. I did quick google
>> > and could not find much.
>> 
>> That should have been EVM and IMA.  Look under security/integrity/.  I
>> don't know much about them but they appear to be security modules with a
>> focus on verifying checksum or perhaps encrypted hashes of executables
>> are consistent.
>
> I will do some quick search there and I see if I can understand something.
>
> [..]
>> It just occurred to me there is a 4th approach we can take that seems
>> interesting.
>> 
>> Have a system call where you pass in a signature of yourself, that will
>> allow you to increase your set of capabilities.  I am a good binary here
>> is proof.  I initially that it might be a complement to sys_kexec_load
>> just for the kexec case but there is no reason to limit it.
>
> If one presents its own signature, then anybody can copy and present
> that signature. There needs to be a mechanism to verify that you 
> actually have the signature you are presenting (i mean digest of
> executable).
>
> So above does not address that how that new system call will verify the
> signature/hash of process invoking system call.

Of course it would.  A signature by it's very definition is a signed
digest.  You can present your own signature and the process that
presents that signature can be verified against the signature.

>> > - What happens to purgatory code. It is unsigned piece of code which
>> >   runs in kernel?
>> 
>> The purgatory code would need to be signed.  Which is why it is
>> important to enable composition of signed pieces of code.
>
> purgatory code is modified dynamically upon every invocation of kexec.
> That means there needs to be a mechanism to sign it after we are done
> with purgatory modification. But there are no signing keys available
> on the system. All the signing happens externally during build time. So
> we don't have the option of signing purgatory at run time.

Hogwash.

The only significant modification we make to purgatory is relocation
processing.  That relocation processing is a convinience, not a
necessity.  Potentially we could move the relocation processing into
purgatory itself.

To making signing work how we process and deal with purgatory would need
to be changed a bit, but fundmanetally signing purgatory or a couple
of specialized versions of purgatory is totally doable.

Eric

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  parent reply	other threads:[~2012-10-23 15:52 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  3:10 [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting Dave Young
2012-10-18 14:56 ` Khalid Aziz
2012-10-18 19:11   ` Vivek Goyal
2012-10-18 19:22     ` Khalid Aziz
2012-10-18 19:38       ` [RFC] Kdump with UEFI secure boot (Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting) Vivek Goyal
2012-10-18 19:55         ` Matthew Garrett
2012-10-18 22:25         ` Eric W. Biederman
2012-10-19  2:06           ` Vivek Goyal
2012-10-19  3:36             ` Eric W. Biederman
2012-10-19 14:31               ` Vivek Goyal
2012-10-22 20:43                 ` Vivek Goyal
2012-10-22 21:11                   ` Eric W. Biederman
2012-10-23  2:04                   ` Simon Horman
2012-10-23 13:24                     ` Vivek Goyal
2012-10-23 16:26                       ` [RFC] Kdump with signed images Eric W. Biederman
2012-10-23 17:39                         ` Vivek Goyal
2012-10-23 19:11                           ` Maxim Uvarov
2012-10-23 19:16                             ` Vivek Goyal
2012-10-22 21:07                 ` [RFC] Kdump with UEFI secure boot (Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting) Eric W. Biederman
2012-10-23 13:18                   ` Vivek Goyal
2012-10-23 14:59                     ` Vivek Goyal
2012-10-23 15:41                       ` Matthew Garrett
2012-10-23 16:44                         ` [RFC] Kdump with signed images Eric W. Biederman
2012-10-23 16:52                           ` Matthew Garrett
2012-10-24 17:19                           ` Vivek Goyal
2012-10-25  5:43                             ` Mimi Zohar
2012-10-25  6:44                               ` Kees Cook
2012-10-25  7:01                                 ` Mimi Zohar
2012-10-25 13:54                               ` Vivek Goyal
2012-10-25 19:06                                 ` Mimi Zohar
2012-10-25 15:39                         ` [RFC] Kdump with UEFI secure boot (Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting) Vivek Goyal
2012-10-23 16:19                       ` Kdump with signed images Eric W. Biederman
2012-10-23 16:31                         ` Matthew Garrett
2012-10-23 17:03                           ` Eric W. Biederman
2012-10-23 17:09                             ` Matthew Garrett
2012-10-24 17:36                         ` Vivek Goyal
2012-10-25  6:10                           ` Mimi Zohar
2012-10-25 14:10                             ` Vivek Goyal
2012-10-25 18:40                               ` Mimi Zohar
2012-10-25 18:55                                 ` Vivek Goyal
2012-10-26  1:15                                   ` Mimi Zohar
2012-10-26  2:39                                     ` Matthew Garrett
2012-10-26  3:30                                       ` Eric W. Biederman
2012-10-26 17:06                                       ` Vivek Goyal
2012-10-26 18:37                                         ` Mimi Zohar
2012-11-01 13:10                                           ` Vivek Goyal
2012-11-01 13:53                                             ` Vivek Goyal
2012-11-01 14:29                                               ` Mimi Zohar
2012-11-01 14:43                                                 ` Vivek Goyal
2012-11-01 14:52                                                   ` Matthew Garrett
2012-11-02 13:23                                                     ` Vivek Goyal
2012-11-02 14:29                                                       ` Balbir Singh
2012-11-02 14:36                                                         ` Vivek Goyal
2012-11-03  3:02                                                           ` Balbir Singh
2012-11-02 21:34                                                         ` H. Peter Anvin
2012-11-02 21:32                                                       ` Eric W. Biederman
2012-11-05 18:03                                                         ` Vivek Goyal
2012-11-05 19:44                                                           ` Eric W. Biederman
2012-11-05 20:42                                                             ` Vivek Goyal
2012-11-05 23:01                                                               ` H. Peter Anvin
2012-11-06 19:34                                                             ` Vivek Goyal
2012-11-06 23:51                                                               ` Eric W. Biederman
2012-11-08 19:40                                                                 ` Vivek Goyal
2012-11-08 19:45                                                                   ` Vivek Goyal
2012-11-08 21:03                                                                     ` Eric W. Biederman
2012-11-09 14:39                                                                       ` Vivek Goyal
2012-11-15  5:09                                                                         ` Eric W. Biederman
2012-11-15 12:56                                                                           ` Mimi Zohar
2012-11-08 20:46                                                                   ` Mimi Zohar
2012-11-01 14:51                                                 ` Vivek Goyal
2012-11-01 14:57                                                   ` Matthew Garrett
2012-11-01 15:10                                                     ` Khalid Aziz
2012-11-01 16:23                                                       ` Matthew Garrett
2012-11-02 16:57                                                         ` Khalid Aziz
2012-10-26 17:59                                       ` Mimi Zohar
2012-10-26 18:19                                         ` Matthew Garrett
2012-10-26 18:25                                           ` Mimi Zohar
2012-10-23 15:51                     ` Eric W. Biederman [this message]
2012-10-23 17:18                       ` [RFC] Kdump with UEFI secure boot (Re: [PATCH v2] kdump: pass acpi_rsdp= to 2nd kernel for efi booting) Vivek Goyal
2012-10-19 17:53               ` Vivek Goyal
2012-10-22 21:15                 ` Eric W. Biederman
2012-11-02 21:36                   ` H. Peter Anvin
2012-11-05 18:11                     ` Vivek Goyal
2012-11-05 19:54                       ` Eric W. Biederman

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=87hapl6vae.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=dyoung@redhat.com \
    --cc=horms@verge.net.au \
    --cc=hpa@zytor.com \
    --cc=kexec@lists.infradead.org \
    --cc=khalid@gonehiking.org \
    --cc=mjg@redhat.com \
    --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