diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2026-07-09 21:35:06 +0200 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-07-10 14:41:43 +0200 |
| commit | e72b793ae440f6900fb17a4b8518c707b5cd3e17 (patch) | |
| tree | bcda4db241368a1c88f50d1c69259e35437e9c33 | |
| parent | 72e9ec2fe32b00994f41719cf77423fca67d48b2 (diff) | |
| download | linux-next-e72b793ae440f6900fb17a4b8518c707b5cd3e17.tar.gz linux-next-e72b793ae440f6900fb17a4b8518c707b5cd3e17.zip | |
dm-verity: fix a possible NULL pointer dereference
Fix a possible NULL pointer dereference dm_verity_loadpin_is_bdev_trusted
if the device has no table.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-4-6
Fixes: b6c1c5745ccc ("dm: Add verity helpers for LoadPin")
Cc: stable@vger.kernel.org
| -rw-r--r-- | drivers/md/dm-verity-loadpin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-verity-loadpin.c b/drivers/md/dm-verity-loadpin.c index 0666699b6858..9a64f575ae5f 100644 --- a/drivers/md/dm-verity-loadpin.c +++ b/drivers/md/dm-verity-loadpin.c @@ -70,7 +70,7 @@ bool dm_verity_loadpin_is_bdev_trusted(struct block_device *bdev) table = dm_get_live_table(md, &srcu_idx); - if (table->num_targets != 1) + if (!table || table->num_targets != 1) goto out; ti = dm_table_get_target(table, 0); |
