linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Coiby Xu <coxu@redhat.com>
Cc: kexec@lists.infradead.org, Matthew Garrett <mjg59@srcf.ucam.org>,
	Jiri Bohac <jbohac@suse.cz>, David Howells <dhowells@redhat.com>,
	linux-integrity@vger.kernel.org,
	Eric Biederman <ebiederm@xmission.com>,
	James Morris <jmorris@namei.org>,
	Matthew Garrett <mjg59@google.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] lockdown: kexec_file: prevent unsigned kernel image when KEXEC_SIG not enabled
Date: Mon, 28 Nov 2022 12:16:08 -0500	[thread overview]
Message-ID: <2204915d319ff9acf80f68ccba8600aaeb5578d7.camel@linux.ibm.com> (raw)
In-Reply-To: <20221122023606.nrifkrng5nbfmkka@Rk>

On Tue, 2022-11-22 at 10:36 +0800, Coiby Xu wrote:
> Hi Mimi,
> 
> On Mon, Nov 21, 2022 at 01:23:57PM -0500, Mimi Zohar wrote:
> >Hi Coiby,
> >
> >On Mon, 2022-11-21 at 15:29 +0800, Coiby Xu wrote:
> >> A kernel builder may not enable KEXEC_SIG and some architectures like
> >> ppc64 simply don't have KEXEC_SIG. In these cases, unless both
> >> IMA_ARCH_POLICY and secure boot also enabled, lockdown doesn't prevent
> >> unsigned kernel image from being kexec'ed via the kexec_file_load
> >> syscall whereas it could prevent one via the kexec_load syscall. Mandate
> >> signature verification for those cases.
> >>
> >> Fixes: 155bdd30af17 ("kexec_file: Restrict at runtime if the kernel is locked down")
> >> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> >> Cc: Jiri Bohac <jbohac@suse.cz>
> >> Cc: David Howells <dhowells@redhat.com>
> >> Cc: kexec@lists.infradead.org
> >> Cc: linux-integrity@vger.kernel.org
> >> Signed-off-by: Coiby Xu <coxu@redhat.com>
> >
> >Other than correcting the function name to mandate_signature_verificati
> >on(),
> 
> Applied to v2, thanks for correcting me! Btw, I realize I overwrote the
> return code of kexec_image_verify_sig with
> mandate_signature_verification's. v2 has fixed this issue as well.
> 
> >
> >Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
> 
> And thanks for the review!

You're welcome.

Without either IMA_ARCH or KEXEC_SIG enabled, the kexec selftest
test_kexec_file_load.sh properly failed with "kexec_file_load failed
[PASS]", but from the informational messages output, it isn't clear why
it failed.  This should be corrected.

-- 
thanks,

Mimi


  reply	other threads:[~2022-11-28 17:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  7:29 [PATCH] lockdown: kexec_file: prevent unsigned kernel image when KEXEC_SIG not enabled Coiby Xu
2022-11-21 18:23 ` Mimi Zohar
2022-11-22  2:36   ` Coiby Xu
2022-11-28 17:16     ` Mimi Zohar [this message]
2022-12-30  7:00       ` Coiby Xu
2022-11-22  2:28 ` [PATCH v2] " Coiby Xu

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=2204915d319ff9acf80f68ccba8600aaeb5578d7.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=coxu@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=jbohac@suse.cz \
    --cc=jmorris@namei.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@google.com \
    --cc=mjg59@srcf.ucam.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).