Skip to content

Commit de15ea2

Browse files
committed
objtool: Revert "skip non-text sections when adding return-thunk sites"
JIRA: https://issues.redhat.com/browse/RHEL-71467 Upstream Status: RHEL only The RHEL only commit d0fd1f5 ("objtool: skip non-text sections when adding return-thunk sites") is based on a linux stable commit like the linux-5.18.y's commit f7b097e ("objtool: skip non-text sections when adding return-thunk sites") to work around an x86 linking problem at the time. Now the linking problem doesn't seem to be present anymore with the latest RHEL9 source code. It is time to revert the commit as it is causing objtool to ignore return sites in .altinstr_replacement created by the ALTERNATIVE* macros. So these return sites never gets added to .return.sites and thus doesn't get patched by apply_returns(). This is bad as they can be potential security holes even if RETBleed mitigation has been enabled. Thank Josh Poimboeuf for figuring out this bug. Signed-off-by: Waiman Long <longman@redhat.com>
1 parent c7149de commit de15ea2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/objtool/check.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,8 +1458,7 @@ static void add_return_call(struct objtool_file *file, struct instruction *insn,
14581458
insn->type = INSN_RETURN;
14591459
insn->retpoline_safe = true;
14601460

1461-
/* Skip the non-text sections, specially .discard ones */
1462-
if (add && insn->sec->text)
1461+
if (add)
14631462
list_add_tail(&insn->call_node, &file->return_thunk_list);
14641463
}
14651464

0 commit comments

Comments
 (0)