Skip to content

Commit e1a9dda

Browse files
jpoimboeingomolnar
authored andcommitted
objtool: Properly disable uaccess validation
If opts.uaccess isn't set, the uaccess validation is disabled, but only partially: it doesn't read the uaccess_safe_builtin list but still tries to do the validation. Disable it completely to prevent false warnings. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/0e95581c1d2107fb5f59418edf2b26bba38b0cbb.1742852846.git.jpoimboe@kernel.org
1 parent 6b023c7 commit e1a9dda

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tools/objtool/check.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3187,7 +3187,7 @@ static int handle_insn_ops(struct instruction *insn,
31873187
if (update_cfi_state(insn, next_insn, &state->cfi, op))
31883188
return 1;
31893189

3190-
if (!insn->alt_group)
3190+
if (!opts.uaccess || !insn->alt_group)
31913191
continue;
31923192

31933193
if (op->dest.type == OP_DEST_PUSHF) {
@@ -3647,6 +3647,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
36473647
return 0;
36483648

36493649
case INSN_STAC:
3650+
if (!opts.uaccess)
3651+
break;
3652+
36503653
if (state.uaccess) {
36513654
WARN_INSN(insn, "recursive UACCESS enable");
36523655
return 1;
@@ -3656,6 +3659,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
36563659
break;
36573660

36583661
case INSN_CLAC:
3662+
if (!opts.uaccess)
3663+
break;
3664+
36593665
if (!state.uaccess && func) {
36603666
WARN_INSN(insn, "redundant UACCESS disable");
36613667
return 1;
@@ -4114,7 +4120,8 @@ static int validate_symbol(struct objtool_file *file, struct section *sec,
41144120
if (!insn || insn->visited)
41154121
return 0;
41164122

4117-
state->uaccess = sym->uaccess_safe;
4123+
if (opts.uaccess)
4124+
state->uaccess = sym->uaccess_safe;
41184125

41194126
ret = validate_branch(file, insn_func(insn), insn, *state);
41204127
if (ret)

0 commit comments

Comments
 (0)