From: B Horn Date: Fri, 1 Nov 2024 19:37:32 +0000 (+0000) Subject: kern/dl: Use correct segment in grub_dl_set_mem_attrs() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d72208423dcabf9eb4a3bcb17b6b31888396bd49;p=thirdparty%2Fgrub.git 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 Signed-off-by: B Horn Reviewed-by: Daniel Kiper --- diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c index 99bc12385..acc6ccad6 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -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. */