Skip to content

Commit 231af47

Browse files
Matthias Kaehlckekees
authored andcommitted
dm: verity-loadpin: Use CONFIG_SECURITY_LOADPIN_VERITY for conditional compilation
The verity glue for LoadPin is only needed when CONFIG_SECURITY_LOADPIN_VERITY is set, use this option for conditional compilation instead of the combo of CONFIG_DM_VERITY and CONFIG_SECURITY_LOADPIN. Signed-off-by: Matthias Kaehlcke <[email protected]> Acked-by: Mike Snitzer <[email protected]> Link: https://lore.kernel.org/lkml/20220627083512.v7.3.I5aca2dcc3b06de4bf53696cd21329dce8272b8aa@changeid Signed-off-by: Kees Cook <[email protected]>
1 parent 3f805f8 commit 231af47

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

drivers/md/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ obj-$(CONFIG_DM_LOG_WRITES) += dm-log-writes.o
8383
obj-$(CONFIG_DM_INTEGRITY) += dm-integrity.o
8484
obj-$(CONFIG_DM_ZONED) += dm-zoned.o
8585
obj-$(CONFIG_DM_WRITECACHE) += dm-writecache.o
86+
obj-$(CONFIG_SECURITY_LOADPIN_VERITY) += dm-verity-loadpin.o
8687

8788
ifeq ($(CONFIG_DM_INIT),y)
8889
dm-mod-objs += dm-init.o
@@ -108,12 +109,6 @@ ifeq ($(CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG),y)
108109
dm-verity-objs += dm-verity-verify-sig.o
109110
endif
110111

111-
ifeq ($(CONFIG_DM_VERITY),y)
112-
ifeq ($(CONFIG_SECURITY_LOADPIN),y)
113-
dm-verity-objs += dm-verity-loadpin.o
114-
endif
115-
endif
116-
117112
ifeq ($(CONFIG_DM_AUDIT),y)
118113
dm-mod-objs += dm-audit.o
119114
endif

include/linux/dm-verity-loadpin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct dm_verity_loadpin_trusted_root_digest {
1515
u8 data[];
1616
};
1717

18-
#if IS_ENABLED(CONFIG_SECURITY_LOADPIN) && IS_BUILTIN(CONFIG_DM_VERITY)
18+
#if IS_ENABLED(CONFIG_SECURITY_LOADPIN_VERITY)
1919
bool dm_verity_loadpin_is_bdev_trusted(struct block_device *bdev);
2020
#else
2121
static inline bool dm_verity_loadpin_is_bdev_trusted(struct block_device *bdev)

0 commit comments

Comments
 (0)