Skip to content

Commit 91e3265

Browse files
arndbmimizohar
authored andcommitted
ima: rework CONFIG_IMA dependency block
Changing the direct dependencies of IMA_BLACKLIST_KEYRING and IMA_LOAD_X509 caused them to no longer depend on IMA, but a a configuration without IMA results in link failures: arm-linux-gnueabi-ld: security/integrity/iint.o: in function `integrity_load_keys': iint.c:(.init.text+0xd8): undefined reference to `ima_load_x509' aarch64-linux-ld: security/integrity/digsig_asymmetric.o: in function `asymmetric_verify': digsig_asymmetric.c:(.text+0x104): undefined reference to `ima_blacklist_keyring' Adding explicit dependencies on IMA would fix this, but a more reliable way to do this is to enclose the entire Kconfig file in an 'if IMA' block. This also allows removing the existing direct dependencies. Fixes: be210c6 ("ima: Finish deprecation of IMA_TRUSTED_KEYRING Kconfig") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
1 parent be210c6 commit 91e3265

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

security/integrity/ima/Kconfig

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ config IMA
2929
to learn more about IMA.
3030
If unsure, say N.
3131

32+
if IMA
33+
3234
config IMA_KEXEC
3335
bool "Enable carrying the IMA measurement list across a soft boot"
34-
depends on IMA && TCG_TPM && HAVE_IMA_KEXEC
36+
depends on TCG_TPM && HAVE_IMA_KEXEC
3537
default n
3638
help
3739
TPM PCRs are only reset on a hard reboot. In order to validate
@@ -43,7 +45,6 @@ config IMA_KEXEC
4345

4446
config IMA_MEASURE_PCR_IDX
4547
int
46-
depends on IMA
4748
range 8 14
4849
default 10
4950
help
@@ -53,15 +54,14 @@ config IMA_MEASURE_PCR_IDX
5354

5455
config IMA_LSM_RULES
5556
bool
56-
depends on IMA && AUDIT && (SECURITY_SELINUX || SECURITY_SMACK || SECURITY_APPARMOR)
57+
depends on AUDIT && (SECURITY_SELINUX || SECURITY_SMACK || SECURITY_APPARMOR)
5758
default y
5859
help
5960
Disabling this option will disregard LSM based policy rules.
6061

6162
choice
6263
prompt "Default template"
6364
default IMA_NG_TEMPLATE
64-
depends on IMA
6565
help
6666
Select the default IMA measurement template.
6767

@@ -80,14 +80,12 @@ endchoice
8080

8181
config IMA_DEFAULT_TEMPLATE
8282
string
83-
depends on IMA
8483
default "ima-ng" if IMA_NG_TEMPLATE
8584
default "ima-sig" if IMA_SIG_TEMPLATE
8685

8786
choice
8887
prompt "Default integrity hash algorithm"
8988
default IMA_DEFAULT_HASH_SHA1
90-
depends on IMA
9189
help
9290
Select the default hash algorithm used for the measurement
9391
list, integrity appraisal and audit log. The compiled default
@@ -117,7 +115,6 @@ endchoice
117115

118116
config IMA_DEFAULT_HASH
119117
string
120-
depends on IMA
121118
default "sha1" if IMA_DEFAULT_HASH_SHA1
122119
default "sha256" if IMA_DEFAULT_HASH_SHA256
123120
default "sha512" if IMA_DEFAULT_HASH_SHA512
@@ -126,7 +123,6 @@ config IMA_DEFAULT_HASH
126123

127124
config IMA_WRITE_POLICY
128125
bool "Enable multiple writes to the IMA policy"
129-
depends on IMA
130126
default n
131127
help
132128
IMA policy can now be updated multiple times. The new rules get
@@ -137,7 +133,6 @@ config IMA_WRITE_POLICY
137133

138134
config IMA_READ_POLICY
139135
bool "Enable reading back the current IMA policy"
140-
depends on IMA
141136
default y if IMA_WRITE_POLICY
142137
default n if !IMA_WRITE_POLICY
143138
help
@@ -147,7 +142,6 @@ config IMA_READ_POLICY
147142

148143
config IMA_APPRAISE
149144
bool "Appraise integrity measurements"
150-
depends on IMA
151145
default n
152146
help
153147
This option enables local measurement integrity appraisal.
@@ -304,7 +298,6 @@ config IMA_APPRAISE_SIGNED_INIT
304298

305299
config IMA_MEASURE_ASYMMETRIC_KEYS
306300
bool
307-
depends on IMA
308301
depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
309302
default y
310303

@@ -323,7 +316,8 @@ config IMA_SECURE_AND_OR_TRUSTED_BOOT
323316

324317
config IMA_DISABLE_HTABLE
325318
bool "Disable htable to allow measurement of duplicate records"
326-
depends on IMA
327319
default n
328320
help
329321
This option disables htable to allow measurement of duplicate records.
322+
323+
endif

0 commit comments

Comments
 (0)