From: Vivek Goyal <vgoyal@redhat.com>
To: "Kasatkin, Dmitry" <dmitry.kasatkin@intel.com>
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org, pjones@redhat.com, hpa@zytor.com,
dhowells@redhat.com, jwboyer@redhat.com,
Andrew Morton <akpm@linux-foundation.org>,
linux-security-module@vger.kernel.org
Subject: Re: [PATCH 2/3] binfmt_elf: Verify signature of signed elf binary
Date: Thu, 17 Jan 2013 10:18:25 -0500 [thread overview]
Message-ID: <20130117151825.GA12165@redhat.com> (raw)
In-Reply-To: <CALLzPKam_j==PXtNfQs93NbPTrYCjqM_0+XRfnvxrJBLdOJ-vQ@mail.gmail.com>
On Thu, Jan 17, 2013 at 04:58:02PM +0200, Kasatkin, Dmitry wrote:
> On Wed, Jan 16, 2013 at 11:53 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
> > On Wed, Jan 16, 2013 at 02:24:50PM -0500, Mimi Zohar wrote:
> > [..]
> >> > > Sorry, this is out of scope for IMA. Dmitry has looked into this, but
> >> > > I'm not sure where it stands at the moment.
> >> >
> >> > Ok, so that's one reason that why I wrote these patcehs. IMA currently
> >> > is not doing following things to make sure address space of signed images
> >> > is not modified by others.
> >> >
> >> > - Protecting against modifications to pages on swap.
> >> > - Protecting against modifications by ptrace.
> >> > - Protecting against modifications which bypassed filesystem and directly
> >> > wrote to the block.
> >> >
> >> > Locking down all the pages of signed binaries in memory hopefully should
> >> > solve above problems.
> >>
> >> Signing and verifying ELF executables goes back a long time ~2003/4,
> >> from a number of esteemed kernel developers, including Greg-KH and Serge
> >> Hallyn.
> >>
> >> IMA-appraisal isn't limited to appraising a single type of file, but is
> >> a generic mechanism for appraising all files. If there are issues that
> >> aren't being addressed, then by all means, please help by addressing
> >> them. Duplicating a large portion of the code is not productive.
> >
> > So do you have ideas on how to address above mentioned issues. Do they
> > fit into the realm of IMA/EVM or I just need to write separate code (which
> > I have already done).
> >
> > With above issues, IMA stuff for executable files sounds incomplete.
> >
>
> swap is a last resort. healthy system uses swap minimally.
> It is very easy to add /etc/crypttab which allows to have encrypted swap
>
> # <target name> <source device> <key file> <options>
> swap /dev/sda6 /dev/urandom swap
>
> And it will eliminate plenty of possible attacks.
> Processes have also RW data, modification of those will create huge
> risk for the system...
Hm..., encrypted swap is interesting. It might have overhead too. It is
one way of doing thing, but I think it would be better if we don't rely
on user has setup encrypted swap and provide a way to lock down memory of
signed executables.
>
> But certain locking extensions like you implemented can be added to IMA as well.
Cool. That would help. I am very new to IMA. If you have some ideas on
how to go about it, I can start looking into implementing it.
>
> It was said about ptrace already.
Sorry, did not get what was said about ptrace already? We need to disable
ptrace for signed executables. So can IMA set a process flag upon
signature verification and exec() code can give additional capability. And
as Eric mentioned that should automatically take care of ptrace issue.
>
> > - Protecting against modifications which bypassed filesystem and directly wrote to the block.
>
> Can you please tell a bit more how this patch protect against direct
> writing to the blocks?
If you have loaded all the pages from disk and locked them in memory and
verified the signature, then even if somebody modifies a block on disk
it does not matter. We will not read pages from disk anymore for this
exec(). We verified the signature of executable loaded in memory and
in-memory copy is intact.
So next time somebody tries to execute same binary it will fail (because
of modified block).
Thanks
Vivek
next prev parent reply other threads:[~2013-01-17 15:18 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 21:34 [PATCH 0/3] ELF executable signing and verification Vivek Goyal
2013-01-15 21:34 ` [PATCH 1/3] module: export couple of functions for use in process signature verification Vivek Goyal
2013-01-15 21:34 ` [PATCH 2/3] binfmt_elf: Verify signature of signed elf binary Vivek Goyal
2013-01-16 4:30 ` Eric W. Biederman
2013-01-16 4:55 ` Mimi Zohar
2013-01-16 7:10 ` Eric W. Biederman
2013-01-16 14:00 ` Mimi Zohar
2013-01-16 14:48 ` Vivek Goyal
2013-01-16 15:33 ` Mimi Zohar
2013-01-16 15:54 ` Vivek Goyal
2013-01-16 17:24 ` Mimi Zohar
2013-01-16 18:21 ` Vivek Goyal
2013-01-16 18:45 ` Mimi Zohar
2013-01-16 18:57 ` Vivek Goyal
2013-01-16 19:37 ` Mimi Zohar
2013-01-16 19:47 ` Vivek Goyal
2013-01-16 20:25 ` Mimi Zohar
2013-01-16 21:55 ` Vivek Goyal
2013-01-17 8:37 ` Elena Reshetova
2013-01-17 14:39 ` Kasatkin, Dmitry
2013-01-17 14:35 ` Kasatkin, Dmitry
2013-01-16 16:34 ` Vivek Goyal
2013-01-16 18:08 ` Mimi Zohar
2013-01-16 18:28 ` Vivek Goyal
2013-01-16 19:24 ` Mimi Zohar
2013-01-16 21:53 ` Vivek Goyal
2013-01-17 14:58 ` Kasatkin, Dmitry
2013-01-17 15:06 ` Kasatkin, Dmitry
2013-01-17 15:21 ` Vivek Goyal
2013-01-17 15:18 ` Vivek Goyal [this message]
2013-01-17 16:27 ` Kasatkin, Dmitry
2013-01-17 20:33 ` Frank Ch. Eigler
2013-01-17 20:55 ` Vivek Goyal
2013-01-17 21:46 ` Kasatkin, Dmitry
2013-01-17 21:52 ` Vivek Goyal
2013-01-20 16:36 ` Mimi Zohar
2013-01-21 16:42 ` Vivek Goyal
2013-01-21 18:30 ` Mimi Zohar
2013-01-16 22:35 ` Mimi Zohar
2013-01-16 22:51 ` Vivek Goyal
2013-01-16 23:16 ` Eric W. Biederman
2013-01-17 15:37 ` Mimi Zohar
2013-01-17 15:51 ` Vivek Goyal
2013-01-17 16:32 ` Mimi Zohar
2013-01-17 17:01 ` Kasatkin, Dmitry
2013-01-17 17:03 ` Kasatkin, Dmitry
2013-01-17 17:42 ` Vivek Goyal
2013-01-17 17:36 ` Vivek Goyal
2013-01-20 17:20 ` Mimi Zohar
2013-01-21 15:45 ` Vivek Goyal
2013-01-21 18:44 ` Mimi Zohar
2013-01-20 16:17 ` H. Peter Anvin
2013-01-20 16:55 ` Mimi Zohar
2013-01-20 17:00 ` H. Peter Anvin
2013-01-15 21:34 ` [PATCH 3/3] binfmt_elf: Do not allow exec() if signed binary has intepreter Vivek Goyal
2013-01-15 21:37 ` [PATCH 4/3] User space utility "signelf" to sign elf executable Vivek Goyal
2013-01-15 22:27 ` [PATCH 0/3] ELF executable signing and verification richard -rw- weinberger
2013-01-15 23:15 ` Vivek Goyal
2013-01-15 23:17 ` richard -rw- weinberger
2013-01-17 16:22 ` Kasatkin, Dmitry
2013-01-17 17:25 ` Vivek Goyal
2013-01-22 4:22 ` Rusty Russell
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=20130117151825.GA12165@redhat.com \
--to=vgoyal@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dmitry.kasatkin@intel.com \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=jwboyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=pjones@redhat.com \
--cc=zohar@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.