Skip to content

Commit 9356fcf

Browse files
jxwufanMike Snitzer
authored andcommitted
dm verity: set DM_TARGET_SINGLETON feature flag
The device-mapper has a flag to mark targets as singleton, which is a required flag for immutable targets. Without this flag, multiple dm-verity targets can be added to a mapped device, which has no practical use cases and will let dm_table_get_immutable_target return NULL. This patch adds the missing flag, restricting only one dm-verity target per mapped device. Signed-off-by: Fan Wu <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 5d8d408 commit 9356fcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/dm-verity-target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ int dm_verity_get_root_digest(struct dm_target *ti, u8 **root_digest, unsigned i
15661566

15671567
static struct target_type verity_target = {
15681568
.name = "verity",
1569-
.features = DM_TARGET_IMMUTABLE,
1569+
.features = DM_TARGET_SINGLETON | DM_TARGET_IMMUTABLE,
15701570
.version = {1, 10, 0},
15711571
.module = THIS_MODULE,
15721572
.ctr = verity_ctr,

0 commit comments

Comments
 (0)