2022-07-28 16:04:40

by Matthias Kaehlcke

[permalink] [raw]
Subject: [PATCH] dm: verity-loadpin: Drop use of dm_table_get_num_targets()

Commit 2aec377a2925 ("dm table: remove dm_table_get_num_targets()
wrapper") in linux-dm/for-next removed the function
dm_table_get_num_targets() which is used by verity-loadpin. Access
table->num_targets directly instead of using the defunct wrapper.

Fixes: b6c1c5745ccc ("dm: Add verity helpers for LoadPin")
Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Matthias Kaehlcke <[email protected]>
---

drivers/md/dm-verity-loadpin.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-verity-loadpin.c b/drivers/md/dm-verity-loadpin.c
index 10c18bc1652c..387ec43aef72 100644
--- a/drivers/md/dm-verity-loadpin.c
+++ b/drivers/md/dm-verity-loadpin.c
@@ -5,6 +5,7 @@
#include <linux/dm-verity-loadpin.h>

#include "dm.h"
+#include "dm-core.h"
#include "dm-verity.h"

#define DM_MSG_PREFIX "verity-loadpin"
@@ -58,7 +59,7 @@ bool dm_verity_loadpin_is_bdev_trusted(struct block_device *bdev)

table = dm_get_live_table(md, &srcu_idx);

- if (dm_table_get_num_targets(table) != 1)
+ if (table->num_targets != 1)
goto out;

ti = dm_table_get_target(table, 0);
--
2.37.1.455.g008518b4e5-goog


2022-07-28 16:38:02

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH] dm: verity-loadpin: Drop use of dm_table_get_num_targets()

Hi,

On Thu, Jul 28, 2022 at 8:54 AM Matthias Kaehlcke <[email protected]> wrote:
>
> Commit 2aec377a2925 ("dm table: remove dm_table_get_num_targets()
> wrapper") in linux-dm/for-next removed the function
> dm_table_get_num_targets() which is used by verity-loadpin. Access
> table->num_targets directly instead of using the defunct wrapper.
>
> Fixes: b6c1c5745ccc ("dm: Add verity helpers for LoadPin")
> Reported-by: Stephen Rothwell <[email protected]>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---
>
> drivers/md/dm-verity-loadpin.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

FWIW:

Reviewed-by: Douglas Anderson <[email protected]>

2022-07-29 04:55:55

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH] dm: verity-loadpin: Drop use of dm_table_get_num_targets()

On Thu, 28 Jul 2022 08:54:41 -0700, Matthias Kaehlcke wrote:
> Commit 2aec377a2925 ("dm table: remove dm_table_get_num_targets()
> wrapper") in linux-dm/for-next removed the function
> dm_table_get_num_targets() which is used by verity-loadpin. Access
> table->num_targets directly instead of using the defunct wrapper.
>
>

Applied to for-next/hardening, thanks!

[1/1] dm: verity-loadpin: Drop use of dm_table_get_num_targets()
https://git.kernel.org/kees/c/27603a606fda

--
Kees Cook