grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SECURITY PATCH 088/117] disk/lvm: Bail on missing PV list


From: Daniel Kiper
Subject: [SECURITY PATCH 088/117] disk/lvm: Bail on missing PV list
Date: Tue, 2 Mar 2021 19:01:35 +0100

From: Daniel Axtens <dja@axtens.net>

There's an if block for the presence of "physical_volumes {", but if
that block is absent, then p remains NULL and a NULL-deref will result
when looking for logical volumes.

It doesn't seem like LVM makes sense without physical volumes, so error
out rather than crashing.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 grub-core/disk/lvm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/grub-core/disk/lvm.c b/grub-core/disk/lvm.c
index b70d7d79f..31bbc9acc 100644
--- a/grub-core/disk/lvm.c
+++ b/grub-core/disk/lvm.c
@@ -409,6 +409,8 @@ grub_lvm_detect (grub_disk_t disk,
              goto fail4;
            }
        }
+      else
+        goto fail4;
 
       p = grub_strstr (p, "logical_volumes {");
       if (p)
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]