linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chester Lin <clin@suse.com>
To: ardb@kernel.org, zohar@linux.ibm.com, jmorris@namei.org,
	serge@hallyn.com, dmitry.kasatkin@gmail.com,
	catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de,
	mingo@redhat.com, bp@alien8.de, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org,
	linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org, x86@kernel.org,
	jlee@suse.com, clin@suse.com
Subject: [PATCH v3 0/3] add ima_arch support for ARM64
Date: Fri, 30 Oct 2020 14:08:37 +0800	[thread overview]
Message-ID: <20201030060840.1810-1-clin@suse.com> (raw)

Add IMA arch dependent support for ARM64. Some IMA functions can check
arch-specific status before running. For example, the ima_load_data
function or the boot param "ima_appraise=" should not be executed when
UEFI secure boot is enabled. We want to fill the gap in order to complete
the IMA support on ARM64.

Changes in v3:
- Generalize efi_get_secureboot() so both ima_arch and efistub can reuse
  it.
- Implement ima_get_efi_secureboot() as the replacement of get_sb_mode()
  so x86 and arm64 can share the same logic.

Changes in v2:
- Separate get_sb_mode() from x86 so all EFI-based architectures can reuse
  the same function.
- Refactor arch/arm64/kernel/ima_arch.c based on Ard's patch[1].

Test platforms:
- ARM64:  QEMU [aarch64-virt] + EDK2/OVMF
- ARM64:  NXP LX2160A-RDB + EDK2
- X86_64: Dell Lattitude 7490 + (BIOS 1.14.0 01/22/2020)

[1] https://www.spinics.net/lists/linux-efi/msg20645.html

Chester Lin (3):
  efi: generalize efi_get_secureboot
  ima: remove get_sb_mode() and create ima_get_efi_secureboot()
  arm64/ima: add ima_arch support

 arch/arm64/Kconfig                        |  1 +
 arch/arm64/kernel/Makefile                |  2 +
 arch/arm64/kernel/ima_arch.c              | 43 +++++++++++++
 arch/x86/kernel/ima_arch.c                | 69 +++++---------------
 drivers/firmware/efi/libstub/Makefile     |  2 +-
 drivers/firmware/efi/libstub/efi-stub.c   |  2 +-
 drivers/firmware/efi/libstub/efistub.h    | 22 ++++---
 drivers/firmware/efi/libstub/secureboot.c | 76 -----------------------
 drivers/firmware/efi/libstub/x86-stub.c   |  2 +-
 include/linux/efi.h                       | 41 +++++++++++-
 include/linux/ima.h                       | 10 +++
 security/integrity/ima/Makefile           |  1 +
 security/integrity/ima/ima_efi.c          | 26 ++++++++
 13 files changed, 154 insertions(+), 143 deletions(-)
 create mode 100644 arch/arm64/kernel/ima_arch.c
 delete mode 100644 drivers/firmware/efi/libstub/secureboot.c
 create mode 100644 security/integrity/ima/ima_efi.c

-- 
2.28.0


             reply	other threads:[~2020-10-30  6:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30  6:08 Chester Lin [this message]
2020-10-30  6:08 ` [PATCH v3 1/3] efi: generalize efi_get_secureboot Chester Lin
2020-10-30 11:51   ` Ard Biesheuvel
2020-11-02  5:30     ` Chester Lin
2020-10-30  6:08 ` [PATCH v3 2/3] ima: replace arch-specific get_sb_mode() with a common helper ima_get_efi_secureboot() Chester Lin
2020-10-30 11:52   ` Ard Biesheuvel
2020-10-30  6:08 ` [PATCH v3 3/3] arm64/ima: add ima_arch support Chester Lin
2020-10-30 11:53   ` Ard Biesheuvel
2020-11-02  7:20     ` Chester Lin
2020-11-02 12:13       ` 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=20201030060840.1810-1-clin@suse.com \
    --to=clin@suse.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jlee@suse.com \
    --cc=jmorris@namei.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=serge@hallyn.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=zohar@linux.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;
as well as URLs for NNTP newsgroup(s).