kern/dl: Use correct segment in grub_dl_set_mem_attrs()

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>
This commit is contained in:
B Horn 2024-11-01 19:37:32 +00:00 committed by Daniel Kiper
parent 500e5fdd82
commit d72208423d

View 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. */