mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
objtool: Properly disable uaccess validation
[ Upstream commit e1a9dda74dbffbc3fa2069ff418a1876dc99fb14 ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2896063907
commit
1fdd7255d5
@@ -3083,7 +3083,7 @@ static int handle_insn_ops(struct instruction *insn,
|
|||||||
if (update_cfi_state(insn, next_insn, &state->cfi, op))
|
if (update_cfi_state(insn, next_insn, &state->cfi, op))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!insn->alt_group)
|
if (!opts.uaccess || !insn->alt_group)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (op->dest.type == OP_DEST_PUSHF) {
|
if (op->dest.type == OP_DEST_PUSHF) {
|
||||||
@@ -3535,6 +3535,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case INSN_STAC:
|
case INSN_STAC:
|
||||||
|
if (!opts.uaccess)
|
||||||
|
break;
|
||||||
|
|
||||||
if (state.uaccess) {
|
if (state.uaccess) {
|
||||||
WARN_FUNC("recursive UACCESS enable", sec, insn->offset);
|
WARN_FUNC("recursive UACCESS enable", sec, insn->offset);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -3544,6 +3547,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case INSN_CLAC:
|
case INSN_CLAC:
|
||||||
|
if (!opts.uaccess)
|
||||||
|
break;
|
||||||
|
|
||||||
if (!state.uaccess && func) {
|
if (!state.uaccess && func) {
|
||||||
WARN_FUNC("redundant UACCESS disable", sec, insn->offset);
|
WARN_FUNC("redundant UACCESS disable", sec, insn->offset);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -3956,7 +3962,8 @@ static int validate_symbol(struct objtool_file *file, struct section *sec,
|
|||||||
if (!insn || insn->ignore || insn->visited)
|
if (!insn || insn->ignore || insn->visited)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
state->uaccess = sym->uaccess_safe;
|
if (opts.uaccess)
|
||||||
|
state->uaccess = sym->uaccess_safe;
|
||||||
|
|
||||||
ret = validate_branch(file, insn->func, insn, *state);
|
ret = validate_branch(file, insn->func, insn, *state);
|
||||||
if (ret && opts.backtrace)
|
if (ret && opts.backtrace)
|
||||||
|
|||||||
Reference in New Issue
Block a user