Skip to content

Commit 13fbe99

Browse files
committed
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fix from Thomas Gleixner: "A single robustness fix for objtool to handle unbalanced CLAC invocations under all circumstances" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Improve UACCESS coverage
2 parents 88c5083 + 882a0db commit 13fbe99

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tools/objtool/check.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,6 +1946,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
19461946
struct alternative *alt;
19471947
struct instruction *insn, *next_insn;
19481948
struct section *sec;
1949+
u8 visited;
19491950
int ret;
19501951

19511952
insn = first;
@@ -1972,12 +1973,12 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
19721973
return 1;
19731974
}
19741975

1976+
visited = 1 << state.uaccess;
19751977
if (insn->visited) {
19761978
if (!insn->hint && !insn_state_match(insn, &state))
19771979
return 1;
19781980

1979-
/* If we were here with AC=0, but now have AC=1, go again */
1980-
if (insn->state.uaccess || !state.uaccess)
1981+
if (insn->visited & visited)
19811982
return 0;
19821983
}
19831984

@@ -2024,7 +2025,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
20242025
} else
20252026
insn->state = state;
20262027

2027-
insn->visited = true;
2028+
insn->visited |= visited;
20282029

20292030
if (!insn->ignore_alts) {
20302031
bool skip_orig = false;

tools/objtool/check.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ struct instruction {
3333
unsigned int len;
3434
enum insn_type type;
3535
unsigned long immediate;
36-
bool alt_group, visited, dead_end, ignore, hint, save, restore, ignore_alts;
36+
bool alt_group, dead_end, ignore, hint, save, restore, ignore_alts;
3737
bool retpoline_safe;
38+
u8 visited;
3839
struct symbol *call_dest;
3940
struct instruction *jump_dest;
4041
struct instruction *first_jump_src;

0 commit comments

Comments
 (0)