* [GIT PULL] integrity subsystem updates for v5.4 @ 2019-09-11 21:29 Mimi Zohar 2019-09-16 20:38 ` Linus Torvalds 2019-09-28 3:00 ` pr-tracker-bot 0 siblings, 2 replies; 5+ messages in thread From: Mimi Zohar @ 2019-09-11 21:29 UTC (permalink / raw) To: Linus Torvalds; +Cc: linux-security-module, linux-integrity, linux-kernel Hi Linus, The major feature in this pull request is IMA support for measuring and appraising appended file signatures. In addition are a couple of bug fixes and code cleanup to use struct_size(). In addition to the PE/COFF and IMA xattr signatures, the kexec kernel image may be signed with an appended signature, using the same scripts/sign-file tool that is used to sign kernel modules. Similarly, the initramfs may contain an appended signature. (Stephen is carrying a patch to address a merge conflict with the security tree.) thanks, Mimi The following changes since commit 609488bc979f99f805f34e9a32c1e3b71179d10b: Linux 5.3-rc2 (2019-07-28 12:47:02 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git next-integrity for you to fetch changes up to 2a7f0e53daf29ca6dc9fbe2a27158f13474ec1b5: ima: ima_api: Use struct_size() in kzalloc() (2019-08-29 14:23:30 -0400) ---------------------------------------------------------------- Gustavo A. R. Silva (2): ima: use struct_size() in kzalloc() ima: ima_api: Use struct_size() in kzalloc() Mimi Zohar (2): ima: initialize the "template" field with the default template sefltest/ima: support appended signatures (modsig) Sascha Hauer (2): ima: always return negative code for error ima: fix freeing ongoing ahash_request Stephen Rothwell (1): MODSIGN: make new include file self contained Thiago Jung Bauermann (11): MODSIGN: Export module signature definitions PKCS#7: Refactor verify_pkcs7_signature() PKCS#7: Introduce pkcs7_get_digest() integrity: Select CONFIG_KEYS instead of depending on it ima: Add modsig appraise_type option for module-style appended signatures ima: Factor xattr_verify() out of ima_appraise_measurement() ima: Implement support for module-style appended signatures ima: Collect modsig ima: Define ima-modsig template ima: Store the measurement again when appraising a modsig ima: Fix use after free in ima_read_modsig() Documentation/ABI/testing/ima_policy | 6 +- Documentation/security/IMA-templates.rst | 3 + arch/s390/Kconfig | 2 +- arch/s390/kernel/machine_kexec_file.c | 24 +-- certs/system_keyring.c | 61 +++++-- crypto/asymmetric_keys/pkcs7_verify.c | 33 ++++ include/crypto/pkcs7.h | 4 + include/linux/module.h | 3 - include/linux/module_signature.h | 46 +++++ include/linux/verification.h | 10 ++ init/Kconfig | 6 +- kernel/Makefile | 1 + kernel/module.c | 1 + kernel/module_signature.c | 46 +++++ kernel/module_signing.c | 56 +----- scripts/Makefile | 2 +- security/integrity/Kconfig | 2 +- security/integrity/digsig.c | 43 ++++- security/integrity/ima/Kconfig | 13 ++ security/integrity/ima/Makefile | 1 + security/integrity/ima/ima.h | 60 ++++++- security/integrity/ima/ima_api.c | 27 ++- security/integrity/ima/ima_appraise.c | 194 ++++++++++++++------- security/integrity/ima/ima_crypto.c | 10 +- security/integrity/ima/ima_main.c | 24 ++- security/integrity/ima/ima_modsig.c | 168 ++++++++++++++++++ security/integrity/ima/ima_policy.c | 71 ++++++-- security/integrity/ima/ima_template.c | 31 +++- security/integrity/ima/ima_template_lib.c | 64 ++++++- security/integrity/ima/ima_template_lib.h | 4 + security/integrity/integrity.h | 20 +++ .../selftests/kexec/test_kexec_file_load.sh | 38 +++- 32 files changed, 871 insertions(+), 203 deletions(-) create mode 100644 include/linux/module_signature.h create mode 100644 kernel/module_signature.c create mode 100644 security/integrity/ima/ima_modsig.c ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] integrity subsystem updates for v5.4 2019-09-11 21:29 [GIT PULL] integrity subsystem updates for v5.4 Mimi Zohar @ 2019-09-16 20:38 ` Linus Torvalds 2019-09-16 22:13 ` Mimi Zohar 2019-09-28 3:00 ` pr-tracker-bot 1 sibling, 1 reply; 5+ messages in thread From: Linus Torvalds @ 2019-09-16 20:38 UTC (permalink / raw) To: Mimi Zohar; +Cc: linux-security-module, linux-integrity, linux-kernel On Wed, Sep 11, 2019 at 2:29 PM Mimi Zohar <zohar@linux.ibm.com> wrote: > > The major feature in this pull request is IMA support for measuring > and appraising appended file signatures. In addition are a couple of > bug fixes and code cleanup to use struct_size(). How is the file signature any different from (and/or better than) the fs-verity support? The fs-verity support got fairly extensively discussed, and is apparently going to actually be widely used by Android, and it an independent feature of any security model. What does the IMA version bring to the table? Linus ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] integrity subsystem updates for v5.4 2019-09-16 20:38 ` Linus Torvalds @ 2019-09-16 22:13 ` Mimi Zohar 2019-09-27 16:08 ` Mimi Zohar 0 siblings, 1 reply; 5+ messages in thread From: Mimi Zohar @ 2019-09-16 22:13 UTC (permalink / raw) To: Linus Torvalds; +Cc: linux-security-module, linux-integrity, linux-kernel On Mon, 2019-09-16 at 13:38 -0700, Linus Torvalds wrote: > On Wed, Sep 11, 2019 at 2:29 PM Mimi Zohar <zohar@linux.ibm.com> wrote: > > > > The major feature in this pull request is IMA support for measuring > > and appraising appended file signatures. In addition are a couple of > > bug fixes and code cleanup to use struct_size(). > > How is the file signature any different from (and/or better than) the > fs-verity support? > > The fs-verity support got fairly extensively discussed, and is > apparently going to actually be widely used by Android, and it an > independent feature of any security model. > > What does the IMA version bring to the table? IMA currently defines a system wide policy for measuring, verifying a file's integrity (both mutable/immutable files) against known good values, and adding audit records containing the file hashes. The policy isn't hard coded in the kernel, allowing people/companies to configure it as desired for their specific use case. Support for appended signatures already exists in the kernel for kernel modules. This pull request adds IMA support for appended signatures in order to verify the kexec kernel image on OpenPOWER, as part of Secure and Trusted boot enablement. This would allow distros to sign kernel images similar to how they currently sign kernel modules. IMA verifies file signatures up front, before allowing access to the file. fs-verity verifies the signature of the Merkle tree (and other info), but does not verify the file data at the time of first use. There are pros and cons to each of these approaches. Mimi ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] integrity subsystem updates for v5.4 2019-09-16 22:13 ` Mimi Zohar @ 2019-09-27 16:08 ` Mimi Zohar 0 siblings, 0 replies; 5+ messages in thread From: Mimi Zohar @ 2019-09-27 16:08 UTC (permalink / raw) To: Linus Torvalds; +Cc: linux-security-module, linux-integrity, linux-kernel On Mon, 2019-09-16 at 18:13 -0400, Mimi Zohar wrote: > On Mon, 2019-09-16 at 13:38 -0700, Linus Torvalds wrote: > > On Wed, Sep 11, 2019 at 2:29 PM Mimi Zohar <zohar@linux.ibm.com> wrote: > > > > > > The major feature in this pull request is IMA support for measuring > > > and appraising appended file signatures. In addition are a couple of > > > bug fixes and code cleanup to use struct_size(). > > > > How is the file signature any different from (and/or better than) the > > fs-verity support? > > > > The fs-verity support got fairly extensively discussed, and is > > apparently going to actually be widely used by Android, and it an > > independent feature of any security model. > > > > What does the IMA version bring to the table? > > IMA currently defines a system wide policy for measuring, verifying a > file's integrity (both mutable/immutable files) against known good > values, and adding audit records containing the file hashes. The > policy isn't hard coded in the kernel, allowing people/companies to > configure it as desired for their specific use case. > > Support for appended signatures already exists in the kernel for > kernel modules. This pull request adds IMA support for appended > signatures in order to verify the kexec kernel image on OpenPOWER, as > part of Secure and Trusted boot enablement. This would allow distros > to sign kernel images similar to how they currently sign kernel > modules. > > IMA verifies file signatures up front, before allowing access to the > file. fs-verity verifies the signature of the Merkle tree (and other > info), but does not verify the file data at the time of first use. > There are pros and cons to each of these approaches. My writing tends to be brief, hopefully concise. I assume if you had further questions you would have asked. This pull request contained a lot of refactoring of the existing appended signature verification code, so that IMA could retain the existing framework of calculating the file hash once, storing it in the IMA measurement list and extending the TPM, verifying the file's integrity based on a file hash or signature (eg. xattrs), and adding an audit record containing the file hash, all based on policy. (The IMA support for appended signatures patch set was posted and reviewed 11 times.) The support for appended signature paves the way for adding other signature verification methods, such as fs-verity, based on a single system-wide policy. The file hash used for verifying the signature and the signature, itself, can be included in the IMA measurement list. Originally, IMA & EVM were limited to local kernel file systems, based on i_version, but have been extended to support filesystems that don't support i_version and for FUSE. There are additional discussions for extending IMA to support remote filesystems (eg. IETF NFS draft). IMA by itself isn't enough, since the remote file isn't pinned in memory, but will need to be dependent on fs-verity. Nayna Jain re-posted a patch set (v6) titled "powerpc: Enabling IMA arch specific secure boot policies". The changes are based on Michael Ellerman's review. thanks, Mimi ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [GIT PULL] integrity subsystem updates for v5.4 2019-09-11 21:29 [GIT PULL] integrity subsystem updates for v5.4 Mimi Zohar 2019-09-16 20:38 ` Linus Torvalds @ 2019-09-28 3:00 ` pr-tracker-bot 1 sibling, 0 replies; 5+ messages in thread From: pr-tracker-bot @ 2019-09-28 3:00 UTC (permalink / raw) To: Mimi Zohar Cc: Linus Torvalds, linux-security-module, linux-integrity, linux-kernel The pull request you sent on Wed, 11 Sep 2019 17:29:25 -0400: > git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git next-integrity has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/f1f2f614d535564992f32e720739cb53cf03489f Thank you! -- Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-09-28 3:00 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-09-11 21:29 [GIT PULL] integrity subsystem updates for v5.4 Mimi Zohar 2019-09-16 20:38 ` Linus Torvalds 2019-09-16 22:13 ` Mimi Zohar 2019-09-27 16:08 ` Mimi Zohar 2019-09-28 3:00 ` pr-tracker-bot
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).