Hi Peter,

I'm writing to you as the author of this patch in grub:

https://git.savannah.gnu.org/cgit/grub.git/commit/?id=879c4a8342eacc0ba4b9dd11dc69d3ec3dbe73af

We've had a report of a release-critical bug (in CC) against grub in
Debian that claims boot failures after renaming a logical volume:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987008

The suggested patch (author in CC) is quite short:

---------------------------------------------------
Index: grub2-2.02+dfsg1/grub-core/disk/lvm.c
===================================================================
--- grub2-2.02+dfsg1.orig/grub-core/disk/lvm.c
+++ grub2-2.02+dfsg1/grub-core/disk/lvm.c
@@ -253,7 +253,7 @@ error_parsing_metadata:

   p = q = (char *)ptr;

-  if (grub_add ((grub_size_t)metadatabuf, (grub_size_t)mda_size, &ptr))
+  if (grub_add (ptr, (grub_size_t)grub_le_to_cpu64 (rlocn->size), &ptr))
     goto error_parsing_metadata;

   mda_end = (char *)ptr;
----------------------------------------------------

I have tried to review the patch but quickly got lost in this long
function, so I'm not sure it's the right fix.

Could you expand on the rationale on why the rlocn->offset is checked
first but mda_size instead of rlocn->size in the second case?

Thank you for any input,

a.

Attachment: signature.asc
Description: PGP signature

Reply via email to