]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
kern/dl: Use correct segment in grub_dl_set_mem_attrs()
authorB Horn <b@horn.uk>
Fri, 1 Nov 2024 19:37:32 +0000 (19:37 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 13 Feb 2025 14:45:55 +0000 (15:45 +0100)
The previous code would never actually call grub_update_mem_attrs()
as sh_info will always be zero for the sections that exist in memory.

Reported-by: B Horn <b@horn.uk>
Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/dl.c

index 99bc123850c93588aff50ee4e528e8f42e43d95e..acc6ccad64c76f5185074165383624bb579ba3c1 100644 (file)
@@ -668,7 +668,7 @@ grub_dl_set_mem_attrs (grub_dl_t mod, void *ehdr)
 
       for (seg = mod->segment; seg; seg = seg->next)
        /* Does this ELF section's index match GRUB DL segment? */
-       if (seg->section == s->sh_info)
+       if (seg->section == i)
          break;
 
       /* No GRUB DL segment found for this ELF section, skip it. */