Skip to content

Commit

Permalink
BACKPORT: dm verity: set DM_TARGET_IMMUTABLE feature flag
Browse files Browse the repository at this point in the history
commit 4caae58406f8ceb741603eee460d79bacca9b1b5 upstream.

The device-mapper framework provides a mechanism to mark targets as
immutable (and hence fail table reloads that try to change the target
type). Add the DM_TARGET_IMMUTABLE flag to the dm-verity target's
feature flags to prevent switching the verity target with a different
target type.

Bug: 234475629
Fixes: a4ffc15 ("dm: add verity target")
Cc: [email protected]
Signed-off-by: Sarthak Kukreti <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Change-Id: Iaeec7fa3be98a646062439e4551f84242dacfb45
  • Loading branch information
skukret authored and chrmhoffmann committed Feb 28, 2023
1 parent 3bc4d0b commit 22eb255
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/dm-verity-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ EXPORT_SYMBOL_GPL(verity_ctr);

static struct target_type verity_target = {
.name = "verity",
.features = DM_TARGET_IMMUTABLE,
.version = {1, 4, 0},
.module = THIS_MODULE,
.ctr = verity_ctr,
Expand Down

0 comments on commit 22eb255

Please sign in to comment.