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 A5C272561AB for ; Tue, 2 Dec 2025 16:41:16 +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=1764693676; cv=none; b=QR++B8pS2Albab+LuozEey0ADyfmj28zaxflSMx4YYlYoQ/a4wZPMM3MkyZPLkgg1+a4J57FMNQi1EKCvSYfoPBtmN26m4MOuRoHo0+BrQOajFp0/BrJcdNvfW/HQuQ594Dorf2ikzyTbvG5PqoBG74Jt7mwsiCi3y71oxWAyW0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764693676; c=relaxed/simple; bh=U/5Zc6jLjBs7MAhxofgDi2Hv7OjBC/lUni2gVJca3po=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=f5WCKWYWJojHR/lCQKwmkFTYFU3PtcMCN+G5TPky9YJkp+QdL0WfLdZ5JQ6cmdfvtrbYDX/TSeHFgYvO/EvtaRzLNXppGujCNEJ6q9MTOA5OD4KpIw+z7Ogbh8So1WVktG9PXgrdjs8eBG8WwucqFJVMAQKuEN6dWpXYEZLKYYo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lVTV79UT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lVTV79UT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84899C4CEF1; Tue, 2 Dec 2025 16:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764693676; bh=U/5Zc6jLjBs7MAhxofgDi2Hv7OjBC/lUni2gVJca3po=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lVTV79UTABhBbP7bZMdmHyCjg8chQaHyRlimDHESirZGQbnFPOSkRQPg8cojC/qsW IpbwckHcf66q21A25clvAQyLEUd9ZUOEsk3wdps/t7UBittcJh9+bvqhO+H1M/KwtL gyJEJrNTRdPETwkPmbIQLkagJEnGogbcddYFLYJjEL8SUyiF6s0ylEkNqeRfI/HIDN pTu0dtbTUSza/nIDkEtX+aYlEdvRC2Pz/x1A90UGnE2itHH7WlAASP5OEExRZgouu/ Vw90D+M+3P7JLQbbehO5XrCFPADlU85Cygw0VXCYpMRrpbVQYYrhz1krau6SM9E6kM xoGu76ZRoAi2w== Date: Tue, 2 Dec 2025 17:41:11 +0100 From: Ingo Molnar To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Peter Zijlstra , Alexandre Chartre , David Laight Subject: Re: [PATCH] objtool: Fix stack overflow in validate_branch() Message-ID: References: <21bb161c23ca0d8c942a960505c0d327ca2dc7dc.1764691895.git.jpoimboe@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: * Josh Poimboeuf wrote: > On Tue, Dec 02, 2025 at 08:16:28AM -0800, Josh Poimboeuf wrote: > > -static int handle_insn_ops(struct instruction *insn, > > - struct instruction *next_insn, > > - struct insn_state *state) > > +static int noinline handle_insn_ops(struct instruction *insn, > > + struct instruction *next_insn, > > + struct insn_state *state) > > { > > + struct insn_state prev_state __maybe_unused = *state; > > struct stack_op *op; > > - int ret; > > + int ret = 0; > > > > for (op = insn->stack_ops; op; op = op->next) { > > > > ret = update_cfi_state(insn, next_insn, &state->cfi, op); > > if (ret) > > - return ret; > > + goto done; > > > > if (!opts.uaccess || !insn->alt_group) > > continue; > > @@ -3303,7 +3304,8 @@ static int handle_insn_ops(struct instruction *insn, > > state->uaccess_stack = 1; > > } else if (state->uaccess_stack >> 31) { > > WARN_INSN(insn, "PUSHF stack exhausted"); > > - return 1; > > + ret = 1; > > + goto done; > > } > > state->uaccess_stack <<= 1; > > state->uaccess_stack |= state->uaccess; > > @@ -3319,6 +3321,8 @@ static int handle_insn_ops(struct instruction *insn, > > } > > } > > > > +done: > > + TRACE_INSN_STATE(insn, &prev_state, state); > > return 0; > > } > > Argh, that should return 'ret'. Ingo, can you fix that or should I post > a v2? No need, I've fixed it up. Thanks, Ingo