From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FFA419E967; Tue, 27 May 2025 17:21:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748366507; cv=none; b=bWJlmdSUVS60rDbOgl4XeIkB7g8H2HEsmIMTDAHvNUVjCDTpr4s5x2WPXX/CN/KxwKi/zu7cuwLglIyloX+JOLq5GwcwiSXoAXZPh1/CFl4rSTJYEQhz1n7GUzivISrlegd7x6cmZME9ZFAHeOJQ+0P2caS1c/V/waO2d4LGBPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748366507; c=relaxed/simple; bh=K/0H98mYmyQD6aG4HjWI6w5piYKY641Cmn+EcsTJA1w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o+OJdjH4n360nKo/+4ob7JgSo400RB6b1AdXhlC6UYmKQ2d7nVo+TWByWVwwHMpfdIRwBlYC46StWRHzJci8ZQcjAijsit+VibrUxk66rcHZsJUSxcOUMy7XX32etSqNrOyoqpJN+cEfW0+AOQSfuZflD0o7CJd1qyLvdigUtiM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=H8om5Z/D; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="H8om5Z/D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA92FC4CEE9; Tue, 27 May 2025 17:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748366507; bh=K/0H98mYmyQD6aG4HjWI6w5piYKY641Cmn+EcsTJA1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H8om5Z/Dp3Id0h6QAzCj27L7HH9ei1NqeFNFuDfixG1IA5KvsSAOExBIl00u6WHHl m9j47ylDJ7z+aojKEoyFs0oZ9uoN/A84JuyJDiyQfADPFzFE2OcbAKCjPTVI8kZw3F 3K8xLjk+sxg0kOCTmcbGZsYG4/CPzKBqUVu0w4Lc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Josh Poimboeuf , Ingo Molnar , Linus Torvalds , Sasha Levin Subject: [PATCH 6.14 091/783] objtool: Properly disable uaccess validation Date: Tue, 27 May 2025 18:18:08 +0200 Message-ID: <20250527162516.845840214@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162513.035720581@linuxfoundation.org> References: <20250527162513.035720581@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josh Poimboeuf [ 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 Signed-off-by: Ingo Molnar Cc: Linus Torvalds Link: https://lore.kernel.org/r/0e95581c1d2107fb5f59418edf2b26bba38b0cbb.1742852846.git.jpoimboe@kernel.org Signed-off-by: Sasha Levin --- tools/objtool/check.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index a7dcf2d00ab65..522ae26f581be 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3209,7 +3209,7 @@ static int handle_insn_ops(struct instruction *insn, if (update_cfi_state(insn, next_insn, &state->cfi, op)) return 1; - if (!insn->alt_group) + if (!opts.uaccess || !insn->alt_group) continue; if (op->dest.type == OP_DEST_PUSHF) { @@ -3676,6 +3676,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, return 0; case INSN_STAC: + if (!opts.uaccess) + break; + if (state.uaccess) { WARN_INSN(insn, "recursive UACCESS enable"); return 1; @@ -3685,6 +3688,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, break; case INSN_CLAC: + if (!opts.uaccess) + break; + if (!state.uaccess && func) { WARN_INSN(insn, "redundant UACCESS disable"); return 1; @@ -4160,7 +4166,8 @@ static int validate_symbol(struct objtool_file *file, struct section *sec, if (!insn || insn->ignore || insn->visited) return 0; - state->uaccess = sym->uaccess_safe; + if (opts.uaccess) + state->uaccess = sym->uaccess_safe; ret = validate_branch(file, insn_func(insn), insn, *state); if (ret) -- 2.39.5