Skip to contentSkip to conversation

ima: clean up IMA_MEASURE_PCR_IDX in Kconfig

PATCH In review Julian Braha 2 participants 3 messages Aug 22 – Aug 24

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ima: clean up IMA_MEASURE_PCR_IDX in Kconfig

The IMA_MEASURE_PCR_IDX option is not visible for users to set, so it always uses its default, 10. This means that the 'range 8 14' is dead code, and the "If unsure, use the default 10" in the help text is misleading because the user *has no other choice*.

During the first patch submission to add this option in 2008 [1], the submitter originally gave this option a prompt:

"PCR for Aggregate (8 <= Index <= 14)"

then later removed it in the revision, without adjusting the rest of the option accordingly [2].

Let's clean up this of this IMA_MEASURE_PCR_IDX config option to be consistent with its current, non-visible state.

This dead range was found by kconfirm, a static analysis tool for Kconfig.

---
 security/integrity/ima/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
security/integrity/ima/Kconfig +1 -2
index b3a9f86809b0..8a67bc1faa4c 100644
@@ -46,12 +46,11 @@ config IMA_KEXEC
 
 config IMA_MEASURE_PCR_IDX
 	int
-	range 8 14
 	default 10
 	help
 	  IMA_MEASURE_PCR_IDX determines the TPM PCR register index
 	  that IMA uses to maintain the integrity aggregate of the
-	  measurement list.  If unsure, use the default 10.
+	  measurement list.
 
 config IMA_LSM_RULES
 	bool
Signature · 1 line
2.55.0
maintainer
#1 lore raw
Quoted 13 lines · Julian Braha

The IMA_MEASURE_PCR_IDX option is not visible for users to set, so it always uses its default, 10. This means that the 'range 8 14' is dead code, and the "If unsure, use the default 10" in the help text is misleading because the user *has no other choice*.

During the first patch submission to add this option in 2008 [1], the submitter originally gave this option a prompt:

"PCR for Aggregate (8 <= Index <= 14)"

then later removed it in the revision, without adjusting the rest of the option accordingly [2].

Quoted 6 lines

Let's clean up this of this IMA_MEASURE_PCR_IDX config option to be consistent with its current, non-visible state.

This dead range was found by kconfirm, a static analysis tool for Kconfig.

The PCR index can be specified as a Kconfig IMA_MEASURE_PCR_IDX and on individual policy records via the "pcr=" option.

Mimi

#2 lore raw

Hi Mimi,

Quoted 1 line · Mimi Zohar

The PCR index can be specified as a Kconfig IMA_MEASURE_PCR_IDX

Thanks for the info, this means that there's a bug in the kconfig, rather than the range just being dead.

I'll send a different patch to add a prompt to this IMA_MEASURE_PCR_IDX option.

- Julian