From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: Kees Cook <keescook@chromium.org>,
fsdevel@vger.kernel.org, Dave Young <dyoung@redhat.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
kexec@lists.infradead.org, David Howells <dhowells@redhat.com>,
linux-security-module@vger.kernel.org,
Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-modules@vger.kernel.org
Subject: Re: [RFC PATCH v2 06/11] kexec: replace call to copy_file_from_fd() with kernel version
Date: Tue, 26 Jan 2016 21:48:18 +0100 [thread overview]
Message-ID: <20160126204818.GJ20964@wotan.suse.de> (raw)
In-Reply-To: <1453765692.2803.15.camel@linux.vnet.ibm.com>
On Mon, Jan 25, 2016 at 06:48:12PM -0500, Mimi Zohar wrote:
> On Mon, 2016-01-25 at 21:34 +0100, Luis R. Rodriguez wrote:
> > On Mon, Jan 25, 2016 at 10:04:18AM -0500, Mimi Zohar wrote:
> > > On Mon, 2016-01-25 at 14:37 +0800, Dave Young wrote:
> > > > Hi, Mimi
> > > >
> > > > Besides of code issues, I have several thing to be understand:
> > > >
> > > > What is the effect to kexec behavior with this patchset?
> > > > - without IMA enabled (kconfig or kernel cmdline) it will be same as before?
> > >
> > > Yes, without IMA configured or an IMA policy, it is the same as before.
> >
> > That's a bit unfair to your work here, this actually paves the way
> > for not only IMA but also other LSMs to vet for the kexec/initramfs
> > given LSM hooks are used now on a common kernel read set of functions.
>
> Right, I responded to his questions about IMA and not the bigger picture.
Indeed, its just the bigger picture helps validate your work further.
> > > > - with IMA enabled for kernel bzImage, kexec_file_load will check both ima
> > > > signature and original pe file signature, those two mechanisms are
> > > > somehow duplicated. I'm not sure if we need both for bzImage.
> > >
> > > IMA provides a uniform method of measuring and appraising all files on
> > > the system, based on policy. The IMA policy could prevent the original
> > > kexec syscall.
>
> Sorry for jumping back and forth between security hooks. Similarly, for
> the kernel module hook, it prevents the original kernel module syscall
> as well.
This is indeed an important feature. I know people who don't use IMA won't
care, but people who do should, likewise its also important for the prospects
in design of LSMs if they wanted to consider the prospects of this evaluation
for any of the file types we are now clearly defining.
> > On systems without MODULE_SIG_FORCE, the IMA policy
> > > would require an IMA signature as well. (The current patch would
> > > require both, even when MODULE_SIG_FORCE is enabled.)
> >
> >
> > Right, so what this approach has revealed really is that architecturally
> > MODULE_SIG_FORCE should have been an LSM but its not, its also hard to make it
> > an LSM. Now with LSM stacking this might make more sense but that requires
> > work and who knows when and if that will happen.
>
> I kind of lost you here. A new mini LSM would require file signatures
> of an existing type or would it be a new method for verifying file
> signatures?
No the way I see it is this is a feature for signature verification with all
security mechanisms built-in to the kernel. Clearly there is a difference for
how signatures are defined between file types: modules have signatures built-in
to the file, meanwhile for other files this might be detached (that will be the
case for firmware, sysdata). This has yet to be considered for kexec /
initramfs but it shouldn't' be too hard now to consider that. Its also why
firmware signatures is using a separate kconfig option.
> > In the meantime we'll live
> > with the fact that enabling MODULE_SIG_FORCE means you want to stack on
> > top of the LSMs you have enabled, the MODULE_SIG_FORCE functionality being
> > all kernel related and perhaps easier to manage / set.
>
> As I see it, with MODULE_SIG_FORCE, IMA-appraisal could relax its own
> policy knowing that only signed kernel modules are loaded. Without
> MODULE_SIG_FORCE enabled, then IMA-appraisal needs to do the enforcing,
> of course based on policy.
Sure, up to the LSMs, which begs the question of how an LSM would codify
such stacking assumptions. IIRC stacking will just let the code stack, but
I am not sure if we have a clean way to know: hey the kernel vetted this
file's signature itself, just fyi. Other than #idef'ery or relying on the
.config. What I just described is the case for say IMA and kernel module
firmware signing (note both have separate kconfigs), the same question still
applies to ways LSM stacking can provide a set of security requirements each
could have addressed. All in a clean way.
Luis
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2016-01-26 20:48 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 15:11 [RFC PATCH v2 00/11] vfss: support for a common kernel file loader Mimi Zohar
2016-01-18 15:11 ` [RFC PATCH v2 01/11] ima: separate 'security.ima' reading functionality from collect Mimi Zohar
2016-01-19 20:00 ` Dmitry Kasatkin
2016-01-21 13:19 ` Mimi Zohar
2016-01-21 18:18 ` Dmitry Kasatkin
2016-01-18 15:11 ` [RFC PATCH v2 02/11] vfs: define a generic function to read a file from the kernel Mimi Zohar
2016-01-20 1:09 ` Luis R. Rodriguez
2016-01-21 13:24 ` Mimi Zohar
2016-01-18 15:11 ` [RFC PATCH v2 03/11] ima: provide buffer hash calculation function Mimi Zohar
2016-01-19 19:26 ` Dmitry Kasatkin
2016-01-21 13:18 ` Mimi Zohar
2016-01-18 15:11 ` [RFC PATCH v2 04/11] ima: calculate the hash of a buffer using aynchronous hash(ahash) Mimi Zohar
2016-01-18 15:11 ` [RFC PATCH v2 05/11] ima: define a new hook to measure and appraise a file already in memory Mimi Zohar
2016-01-18 15:11 ` [RFC PATCH v2 06/11] kexec: replace call to copy_file_from_fd() with kernel version Mimi Zohar
2016-01-20 3:22 ` Minfei Huang
2016-01-20 23:12 ` Luis R. Rodriguez
2016-01-21 0:27 ` Dmitry Torokhov
2016-01-25 6:37 ` Dave Young
2016-01-25 7:02 ` Dave Young
2016-01-25 15:04 ` Mimi Zohar
2016-01-25 20:34 ` Luis R. Rodriguez
2016-01-25 23:48 ` Mimi Zohar
2016-01-26 20:48 ` Luis R. Rodriguez [this message]
2016-01-26 1:20 ` Dave Young
2016-01-26 16:40 ` Mimi Zohar
2016-01-27 1:50 ` Dave Young
2016-01-18 15:11 ` [RFC PATCH v2 07/11] firmware: replace call to fw_read_file_contents() " Mimi Zohar
2016-01-20 0:10 ` Kees Cook
2016-01-21 12:04 ` Mimi Zohar
2016-01-20 23:39 ` Luis R. Rodriguez
2016-01-20 23:56 ` Luis R. Rodriguez
2016-01-21 12:05 ` Mimi Zohar
2016-01-21 16:49 ` Luis R. Rodriguez
2016-01-18 15:11 ` [RFC PATCH v2 08/11] module: replace copy_module_from_fd " Mimi Zohar
2016-01-21 0:03 ` Luis R. Rodriguez
2016-01-21 13:12 ` Mimi Zohar
2016-01-21 15:45 ` Paul Moore
2016-01-21 21:15 ` Mimi Zohar
2016-01-21 21:26 ` Paul Moore
2016-01-21 21:58 ` Kees Cook
2016-01-21 16:56 ` Luis R. Rodriguez
2016-01-21 20:37 ` Mimi Zohar
2016-01-18 15:11 ` [RFC PATCH v2 09/11] ima: load policy using path Mimi Zohar
2016-01-21 0:05 ` Luis R. Rodriguez
2016-01-21 13:15 ` Mimi Zohar
2016-01-23 2:59 ` Luis R. Rodriguez
2016-01-18 15:11 ` [RFC PATCH v2 10/11] ima: measure and appraise the IMA policy itself Mimi Zohar
2016-01-18 15:11 ` [RFC PATCH v2 11/11] ima: require signed IMA policy Mimi Zohar
2016-01-21 20:16 ` [RFC PATCH v2 00/11] vfss: support for a common kernel file loader Luis R. Rodriguez
2016-01-21 20:18 ` Mimi Zohar
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=20160126204818.GJ20964@wotan.suse.de \
--to=mcgrof@suse.com \
--cc=dhowells@redhat.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=dyoung@redhat.com \
--cc=fsdevel@vger.kernel.org \
--cc=keescook@chromium.org \
--cc=kexec@lists.infradead.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox