]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Don't make .altinstructions writable
authorJosh Poimboeuf <jpoimboe@redhat.com>
Wed, 23 Jun 2021 15:42:28 +0000 (10:42 -0500)
committerIngo Molnar <mingo@kernel.org>
Thu, 24 Jun 2021 06:55:20 +0000 (08:55 +0200)
commit97a0ee78ea48d24d76fdebdc159ba0114fb30b06
treef35beede10fd6162f6e010d6e2053109c9390ad0
parentc049a819b47e53bf6bbb6ba09c9c159bc2dde275
objtool: Don't make .altinstructions writable

When objtool creates the .altinstructions section, it sets the SHF_WRITE
flag to make the section writable -- unless the section had already been
previously created by the kernel.  The mismatch between kernel-created
and objtool-created section flags can cause failures with external
tooling (kpatch-build).  And the section doesn't need to be writable
anyway.

Make the section flags consistent with the kernel's.

Fixes: db8e6c9e5e72 ("objtool/x86: Rewrite retpoline thunk calls")
Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/6c284ae89717889ea136f9f0064d914cd8329d31.1624462939.git.jpoimboe@redhat.com
tools/objtool/arch/x86/decode.c