Skip to content

Commit 9cdca33

Browse files
committed
Merge tag 'integrity-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
Pull integrity updates from Mimi Zohar: "There are two main changes, one feature removal, some code cleanup, and a number of bug fixes. Main changes: - Detecting secure boot mode was limited to IMA. Make detecting secure boot mode accessible to EVM and other LSMs - IMA sigv3 support was limited to fsverity. Add IMA sigv3 support for IMA regular file hashes and EVM portable signatures Remove: - Remove IMA support for asychronous hash calculation originally added for hardware acceleration Cleanup: - Remove unnecessary Kconfig CONFIG_MODULE_SIG and CONFIG_KEXEC_SIG tests - Add descriptions of the IMA atomic flags Bug fixes: - Like IMA, properly limit EVM "fix" mode - Define and call evm_fix_hmac() to update security.evm - Fallback to using i_version to detect file change for filesystems that do not support STATX_CHANGE_COOKIE - Address missing kernel support for configured (new) TPM hash algorithms - Add missing crypto_shash_final() return value" * tag 'integrity-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: evm: Enforce signatures version 3 with new EVM policy 'bit 3' integrity: Allow sigv3 verification on EVM_XATTR_PORTABLE_DIGSIG ima: add support to require IMA sigv3 signatures ima: add regular file data hash signature version 3 support ima: Define asymmetric_verify_v3() to verify IMA sigv3 signatures ima: remove buggy support for asynchronous hashes integrity: Eliminate weak definition of arch_get_secureboot() ima: Add code comments to explain IMA iint cache atomic_flags ima_fs: Correctly create securityfs files for unsupported hash algos ima: check return value of crypto_shash_final() in boot aggregate ima: Define and use a digest_size field in the ima_algo_desc structure powerpc/ima: Drop unnecessary check for CONFIG_MODULE_SIG ima: efi: Drop unnecessary check for CONFIG_MODULE_SIG/CONFIG_KEXEC_SIG ima: fallback to using i_version to detect file change evm: fix security.evm for a file with IMA signature s390: Drop unnecessary CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT evm: Don't enable fix mode when secure boot is enabled integrity: Make arch_ima_get_secureboot integrity-wide
2 parents ba314ed + 82bbd44 commit 9cdca33

33 files changed

Lines changed: 398 additions & 586 deletions

File tree

Documentation/ABI/testing/evm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Description:
2626
2 Permit modification of EVM-protected metadata at
2727
runtime. Not supported if HMAC validation and
2828
creation is enabled (deprecated).
29+
3 Require asymmetric signatures to be version 3
2930
31 Disable further runtime modification of EVM policy
3031
=== ==================================================
3132

Documentation/ABI/testing/ima_policy

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ Description:
5353
where 'imasig' is the original or the signature
5454
format v2.
5555
where 'modsig' is an appended signature,
56-
where 'sigv3' is the signature format v3. (Currently
57-
limited to fsverity digest based signatures
58-
stored in security.ima xattr. Requires
59-
specifying "digest_type=verity" first.)
56+
where 'sigv3' is the signature format v3.
6057

6158
appraise_flag:= [check_blacklist] (deprecated)
6259
Setting the check_blacklist flag is no longer necessary.
@@ -186,6 +183,11 @@ Description:
186183
appraise func=BPRM_CHECK digest_type=verity \
187184
appraise_type=sigv3
188185

186+
Example of a regular IMA file hash 'appraise' rule requiring
187+
signature version 3 format stored in security.ima xattr.
188+
189+
appraise func=BPRM_CHECK appraise_type=sigv3
190+
189191
All of these policy rules could, for example, be constrained
190192
either based on a filesystem's UUID (fsuuid) or based on LSM
191193
labels.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,23 +2410,6 @@ Kernel parameters
24102410
[IMA] Define a custom template format.
24112411
Format: { "field1|...|fieldN" }
24122412

2413-
ima.ahash_minsize= [IMA] Minimum file size for asynchronous hash usage
2414-
Format: <min_file_size>
2415-
Set the minimal file size for using asynchronous hash.
2416-
If left unspecified, ahash usage is disabled.
2417-
2418-
ahash performance varies for different data sizes on
2419-
different crypto accelerators. This option can be used
2420-
to achieve the best performance for a particular HW.
2421-
2422-
ima.ahash_bufsize= [IMA] Asynchronous hash buffer size
2423-
Format: <bufsize>
2424-
Set hashing buffer size. Default: 4k.
2425-
2426-
ahash performance varies for different chunk sizes on
2427-
different crypto accelerators. This option can be used
2428-
to achieve best performance for particular HW.
2429-
24302413
ima= [IMA] Enable or disable IMA
24312414
Format: { "off" | "on" }
24322415
Default: "on"

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12732,6 +12732,7 @@ R: Eric Snowberg <eric.snowberg@oracle.com>
1273212732
L: linux-integrity@vger.kernel.org
1273312733
S: Supported
1273412734
T: git git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
12735+
F: include/linux/secure_boot.h
1273512736
F: security/integrity/
1273612737
F: security/integrity/ima/
1273712738

arch/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,4 +1839,7 @@ config ARCH_WANTS_PRE_LINK_VMLINUX
18391839
config ARCH_HAS_CPU_ATTACK_VECTORS
18401840
bool
18411841

1842+
config HAVE_ARCH_GET_SECUREBOOT
1843+
def_bool EFI
1844+
18421845
endmenu

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ config PPC_SECURE_BOOT
10581058
depends on IMA_ARCH_POLICY
10591059
imply IMA_SECURE_AND_OR_TRUSTED_BOOT
10601060
select PSERIES_PLPKS if PPC_PSERIES
1061+
select HAVE_ARCH_GET_SECUREBOOT
10611062
help
10621063
Systems with firmware secure boot enabled need to define security
10631064
policies to extend secure boot to the OS. This config allows a user

arch/powerpc/kernel/ima_arch.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
#include <linux/ima.h>
88
#include <asm/secure_boot.h>
99

10-
bool arch_ima_get_secureboot(void)
11-
{
12-
return is_ppc_secureboot_enabled();
13-
}
14-
1510
/*
1611
* The "secure_rules" are enabled only on "secureboot" enabled systems.
1712
* These rules verify the file signatures against known good values.
@@ -63,8 +58,7 @@ static const char *const secure_and_trusted_rules[] = {
6358
const char *const *arch_get_ima_policy(void)
6459
{
6560
if (is_ppc_secureboot_enabled()) {
66-
if (IS_ENABLED(CONFIG_MODULE_SIG))
67-
set_module_sig_enforced();
61+
set_module_sig_enforced();
6862

6963
if (is_ppc_trustedboot_enabled())
7064
return secure_and_trusted_rules;

arch/powerpc/kernel/secure_boot.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
#include <linux/types.h>
77
#include <linux/of.h>
8+
#include <linux/secure_boot.h>
89
#include <linux/string_choices.h>
910
#include <asm/secure_boot.h>
1011

@@ -44,6 +45,11 @@ bool is_ppc_secureboot_enabled(void)
4445
return enabled;
4546
}
4647

48+
bool arch_get_secureboot(void)
49+
{
50+
return is_ppc_secureboot_enabled();
51+
}
52+
4753
bool is_ppc_trustedboot_enabled(void)
4854
{
4955
struct device_node *node;

arch/s390/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ config S390
8080
#
8181
# Note: keep this list sorted alphabetically
8282
#
83-
imply IMA_SECURE_AND_OR_TRUSTED_BOOT
8483
select ALTERNATE_USER_ADDRESS_SPACE
8584
select ARCH_32BIT_USTAT_F_TINODE
8685
select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
@@ -181,6 +180,7 @@ config S390
181180
select GENERIC_IOREMAP if PCI
182181
select HAVE_ALIGNED_STRUCT_PAGE
183182
select HAVE_ARCH_AUDITSYSCALL
183+
select HAVE_ARCH_GET_SECUREBOOT
184184
select HAVE_ARCH_JUMP_LABEL
185185
select HAVE_ARCH_JUMP_LABEL_RELATIVE
186186
select HAVE_ARCH_KASAN

arch/s390/kernel/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ obj-$(CONFIG_STACKPROTECTOR) += stackprotector.o
7171
obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o
7272
obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o
7373
obj-$(CONFIG_CERT_STORE) += cert_store.o
74-
obj-$(CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT) += ima_arch.o
7574

7675
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
7776
obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf.o perf_cpum_sf.o

0 commit comments

Comments
 (0)