Re: [PATCH] x86, relocs: Ignore relocations in .notes section on walk_relocs

From: Ingo Molnar
Date: Fri Mar 22 2024 - 04:45:28 EST



* Kees Cook <keescook@xxxxxxxxxxxx> wrote:

> On Sun, 17 Mar 2024 23:05:47 +0800, Guixiong Wei wrote:
> > The commit aaa8736370db ("x86, relocs: Ignore relocations in
> > .notes section") only ignore .note section on print_absolute_relocs,
> > but it also need to add on walk_relocs to avoid relocations in .note
> > section.
> >
> >
>
> Applied to for-next/hardening, thanks!
>
> [1/1] x86, relocs: Ignore relocations in .notes section on walk_relocs
> https://git.kernel.org/kees/c/6ba438a29b5d

Please don't - these are x86 patches, plus it contains an eyesore - see
below ...

Thanks,

Ingo

relocs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: tip/arch/x86/tools/relocs.c
===================================================================
--- tip.orig/arch/x86/tools/relocs.c
+++ tip/arch/x86/tools/relocs.c
@@ -752,9 +752,8 @@ static void walk_relocs(int (*process)(s
* values there are meant for pre-boot consumption (e.g.
* startup_xen).
*/
- if (sec_applies->shdr.sh_type == SHT_NOTE) {
+ if (sec_applies->shdr.sh_type == SHT_NOTE)
continue;
- }

sh_symtab = sec_symtab->symtab;
sym_strtab = sec_symtab->link->strtab;