[PATCH] dm-verity: fix dm_is_verity_target() when dm-verity is builtin

Kees Cook kees at kernel.org
Wed Jul 3 20:26:17 UTC 2024


On Wed, Jul 03, 2024 at 01:08:13PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers at google.com>
> 
> 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: b6c1c5745ccc ("dm: Add verity helpers for LoadPin")
> Cc: stable at vger.kernel.org
> Cc: Matthias Kaehlcke <mka at chromium.org>
> Cc: Kees Cook <keescook at chromium.org>
> Signed-off-by: Eric Biggers <ebiggers at google.com>

Ah! Nice catch.

Reviewed-by: Kees Cook <kees at kernel.org>

-- 
Kees Cook



More information about the Linux-security-module-archive mailing list