From: Nayna Jain <email@example.com> To: firstname.lastname@example.org, email@example.com, firstname.lastname@example.org Cc: Prakhar Srivastava <email@example.com>, Ard Biesheuvel <firstname.lastname@example.org>, Eric Ricther <email@example.com>, Nayna Jain <firstname.lastname@example.org>, email@example.com, Mimi Zohar <firstname.lastname@example.org>, Claudio Carvalho <email@example.com>, Matthew Garret <firstname.lastname@example.org>, Lakshmi Ramasubramanian <email@example.com>, Greg Kroah-Hartman <firstname.lastname@example.org>, Paul Mackerras <email@example.com>, Jeremy Kerr <firstname.lastname@example.org>, Elaine Palmer <email@example.com>, Oliver O'Halloran <firstname.lastname@example.org>, George Wilson <email@example.com> Subject: [PATCH v9 0/8] powerpc: Enabling IMA arch specific secure boot policies Date: Wed, 23 Oct 2019 22:47:09 -0500 [thread overview] Message-ID: <firstname.lastname@example.org> (raw) This patchset extends the previous version by adding support for checking against a blacklist of binary hashes. The IMA subsystem supports custom, built-in, arch-specific policies to define the files to be measured and appraised. These policies are honored based on priority, where arch-specific policy is the highest and custom is the lowest. PowerNV system uses a Linux-based bootloader to kexec the OS. The bootloader kernel relies on IMA for signature verification of the OS kernel before doing the kexec. This patchset adds support for powerpc arch-specific IMA policies that are conditionally defined based on a system's secure boot and trusted boot states. The OS secure boot and trusted boot states are determined via device-tree properties. The verification needs to be performed only for binaries that are not blacklisted. The kernel currently only checks against the blacklist of keys. However, doing so results in blacklisting all the binaries that are signed by the same key. In order to prevent just one particular binary from being loaded, it must be checked against a blacklist of binary hashes. This patchset also adds support to IMA for checking against a hash blacklist for files. signed by appended signature.  http://patchwork.ozlabs.org/cover/1149262/ Changelog: v9: * Includes feedbacks from Michael * fix the missing of_node_put() * Includes Mimi's feedbacks * fix the policy show() function to display check_blacklist * fix the other comment related and patch description * add the example of blacklist in the Patch 7/8 Note: Patch 7/8 is giving errors when checkpatch.pl is run because of the format of showing measurement record as part of the example. I am not very sure if that can be fixed as we need to represent the measurements as is. v8: * Updates the Patch Description as per Michael's and Mimi's feedback * Includes feedbacks from Michael for the device tree and policies * removes the arch-policy hack by defining three arrays. * fixes related to device-tree calls * other code specific feedbacks * Includes feedbacks from Mimi on the blacklist * generic blacklist function is modified than previous version * other coding fixes v7: * Removes patch related to dt-bindings as per input from Rob Herring. * fixes Patch 1/8 to use new device-tree updates as per Oliver feedback to device-tree documentation in skiboot mailing list. (https://lists.ozlabs.org/pipermail/skiboot/2019-September/015329.html) * Includes feedbacks from Mimi, Thiago * moves function get_powerpc_fw_sb_node() from Patch 1 to Patch 3 * fixes Patch 2/8 to use CONFIG_MODULE_SIG_FORCE. * updates Patch description in Patch 5/8 * adds a new patch to add wrapper is_binary_blacklisted() * removes the patch that deprecated permit_directio v6: * includes feedbacks from Michael Ellerman on the patchset v5 * removed email ids from comments * add the doc for the device-tree * renames the secboot.c to secure_boot.c and secboot.h to secure_boot.h * other code specific fixes * split the patches to differentiate between secureboot and trustedboot state of the system * adds the patches to support the blacklisting of the binary hash. v5: * secureboot state is now read via device tree entry rather than OPAL secure variables * ima arch policies are updated to use policy based template for measurement rules v4: * Fixed the build issue as reported by Satheesh Rajendran. v3: * OPAL APIs in Patch 1 are updated to provide generic interface based on key/keylen. This patchset updates kernel OPAL APIs to be compatible with generic interface. * Patch 2 is cleaned up to use new OPAL APIs. * Since OPAL can support different types of backend which can vary in the variable interpretation, the Patch 2 is updated to add a check for the backend version * OPAL API now expects consumer to first check the supported backend version before calling other secvar OPAL APIs. This check is now added in patch 2. * IMA policies in Patch 3 is updated to specify appended signature and per policy template. * The patches now are free of any EFIisms. v2: * Removed Patch 1: powerpc/include: Override unneeded early ioremap functions * Updated Subject line and patch description of the Patch 1 of this series * Removed dependency of OPAL_SECVAR on EFI, CPU_BIG_ENDIAN and UCS2_STRING * Changed OPAL APIs from static to non-static. Added opal-secvar.h for the same * Removed EFI hooks from opal_secvar.c * Removed opal_secvar_get_next(), opal_secvar_enqueue() and opal_query_variable_info() function * get_powerpc_sb_mode() in secboot.c now directly calls OPAL Runtime API rather than via EFI hooks. * Fixed log messages in get_powerpc_sb_mode() function. * Added dependency for PPC_SECURE_BOOT on configs PPC64 and OPAL_SECVAR * Replaced obj-$(CONFIG_IMA) with obj-$(CONFIG_PPC_SECURE_BOOT) in arch/powerpc/kernel/Makefile Nayna Jain (8): powerpc: detect the secure boot mode of the system powerpc/ima: add support to initialize ima policy rules powerpc: detect the trusted boot state of the system powerpc/ima: define trusted boot policy ima: make process_buffer_measurement() generic certs: add wrapper function to check blacklisted binary hash ima: check against blacklisted hashes for files with modsig powerpc/ima: update ima arch policy to check for blacklist Documentation/ABI/testing/ima_policy | 4 ++ arch/powerpc/Kconfig | 11 ++++ arch/powerpc/include/asm/secure_boot.h | 29 ++++++++++ arch/powerpc/kernel/Makefile | 2 + arch/powerpc/kernel/ima_arch.c | 74 ++++++++++++++++++++++++++ arch/powerpc/kernel/secure_boot.c | 58 ++++++++++++++++++++ certs/blacklist.c | 9 ++++ include/keys/system_keyring.h | 6 +++ include/linux/ima.h | 3 +- security/integrity/ima/ima.h | 11 ++++ security/integrity/ima/ima_appraise.c | 33 ++++++++++++ security/integrity/ima/ima_main.c | 63 ++++++++++++++-------- security/integrity/ima/ima_policy.c | 12 ++++- security/integrity/integrity.h | 1 + 14 files changed, 291 insertions(+), 25 deletions(-) create mode 100644 arch/powerpc/include/asm/secure_boot.h create mode 100644 arch/powerpc/kernel/ima_arch.c create mode 100644 arch/powerpc/kernel/secure_boot.c -- 2.20.1
next reply other threads:[~2019-10-24 3:49 UTC|newest] Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-10-24 3:47 Nayna Jain [this message] 2019-10-24 3:47 ` [PATCH v9 1/8] powerpc: detect the secure boot mode of the system Nayna Jain 2019-10-24 17:26 ` Lakshmi Ramasubramanian 2019-10-25 16:49 ` Nayna Jain 2019-10-24 3:47 ` [PATCH v9 2/8] powerpc/ima: add support to initialize ima policy rules Nayna Jain 2019-10-24 17:35 ` Lakshmi Ramasubramanian 2019-10-25 17:02 ` Nayna Jain 2019-10-25 18:03 ` Lakshmi Ramasubramanian 2019-10-28 23:42 ` Michael Ellerman 2019-10-26 23:52 ` Mimi Zohar 2019-10-28 11:54 ` Mimi Zohar 2019-10-24 3:47 ` [PATCH v9 3/8] powerpc: detect the trusted boot state of the system Nayna Jain 2019-10-24 17:38 ` Lakshmi Ramasubramanian 2019-10-25 16:50 ` Nayna Jain 2019-10-24 3:47 ` [PATCH v9 4/8] powerpc/ima: define trusted boot policy Nayna Jain 2019-10-24 17:40 ` Lakshmi Ramasubramanian 2019-10-24 3:47 ` [PATCH v9 5/8] ima: make process_buffer_measurement() generic Nayna Jain 2019-10-24 15:20 ` Lakshmi Ramasubramanian 2019-10-25 17:24 ` Nayna Jain 2019-10-25 17:32 ` Lakshmi Ramasubramanian 2019-10-27 0:13 ` Mimi Zohar 2019-10-30 15:22 ` Lakshmi Ramasubramanian 2019-10-30 16:35 ` Mimi Zohar 2019-10-24 3:47 ` [PATCH v9 6/8] certs: add wrapper function to check blacklisted binary hash Nayna Jain 2019-10-24 3:47 ` [PATCH v9 7/8] ima: check against blacklisted hashes for files with modsig Nayna Jain 2019-10-24 17:48 ` Lakshmi Ramasubramanian 2019-10-25 17:36 ` Nayna Jain 2019-10-24 3:47 ` [PATCH v9 8/8] powerpc/ima: update ima arch policy to check for blacklist Nayna Jain 2019-10-28 12:10 ` [PATCH v9 0/8] powerpc: Enabling IMA arch specific secure boot policies 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 \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH v9 0/8] powerpc: Enabling IMA arch specific secure boot policies' \ /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
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).