mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
dm-verity: fix dm_is_verity_target() when dm-verity is builtin
commit 3708c7269593b836b1d684214cd9f5d83e4ed3fd upstream.
When CONFIG_DM_VERITY=y, dm_is_verity_target() returned true for any
builtin dm target, not just dm-verity. Fix this by checking for
verity_target instead of THIS_MODULE (which is NULL for builtin code).
Fixes: b6c1c5745c ("dm: Add verity helpers for LoadPin")
Cc: stable@vger.kernel.org
Cc: Matthias Kaehlcke <mka@chromium.org>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0d8a5e11ba
commit
13f4efb2af
@@ -1496,14 +1496,6 @@ bad:
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Check whether a DM target is a verity target.
|
|
||||||
*/
|
|
||||||
bool dm_is_verity_target(struct dm_target *ti)
|
|
||||||
{
|
|
||||||
return ti->type->module == THIS_MODULE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the verity mode (error behavior) of a verity target.
|
* Get the verity mode (error behavior) of a verity target.
|
||||||
*
|
*
|
||||||
@@ -1575,6 +1567,14 @@ static void __exit dm_verity_exit(void)
|
|||||||
module_init(dm_verity_init);
|
module_init(dm_verity_init);
|
||||||
module_exit(dm_verity_exit);
|
module_exit(dm_verity_exit);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check whether a DM target is a verity target.
|
||||||
|
*/
|
||||||
|
bool dm_is_verity_target(struct dm_target *ti)
|
||||||
|
{
|
||||||
|
return ti->type == &verity_target;
|
||||||
|
}
|
||||||
|
|
||||||
MODULE_AUTHOR("Mikulas Patocka <mpatocka@redhat.com>");
|
MODULE_AUTHOR("Mikulas Patocka <mpatocka@redhat.com>");
|
||||||
MODULE_AUTHOR("Mandeep Baines <msb@chromium.org>");
|
MODULE_AUTHOR("Mandeep Baines <msb@chromium.org>");
|
||||||
MODULE_AUTHOR("Will Drewry <wad@chromium.org>");
|
MODULE_AUTHOR("Will Drewry <wad@chromium.org>");
|
||||||
|
|||||||
Reference in New Issue
Block a user