Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796102769; b=NQsPAjlguC180dsm4+eTh8m+Eg4laJ3xXAtjZGON6fgJtH7vtz+UU6oeqs2255IpX2ct H476m8W/rWI4QW77seTvZxIh2zzHSodhECKTQpay/ealcsKts8jA5NA/oGeQYhuvC88Jl WAo1Jvald5BpoIrcu12hBjYNnhDY6wm5Rg2ei4/7Vq6vQH4gTcKc6UIqZkIM8RStQP6Ep DTZvDO5KG6+uDPMF1trCzx9FN6XDxe+SF0MQ/vAv99VC8NXTtzUtA7G5t8uaVrHkOJchL AyTheN6qMuk9QefvCXNXNl0lOtmsLbU3gl3SVJUEySccRUEROMM+m619/PltXEJiH5g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796102769; h=Received:DKIM-Signature:Content-Type:MIME-Version:Message-Id: In-Reply-To:References:Subject:From:To:Cc:Date; bh=nmMS6imKDWtvCUJQ8YMkUw6pCLyw7BDcB1oicbEyTGs=; b=3scA4vwb64I/o5qykSs492bHTxNQbyUHhx5KmyvrPpBGrARD7r+aTKDfZ1DxMAkHB1Yw i6Zpz9mUpjlX/RhSbCFx9077LZX8C56r82w0QVajlaGtMhbEtpGRkToFvfwuXokp2uxK0 xqE+LFeXxVl0PczhOTqZUYm19OIkImezN0F2IPzWex4+ly5ue3/VvC5k0YpS8H1NqUhOe LOVDw4oM9bbPuTdqm/h5txy+OSgAW6A3BaCPmWbDk+R+ofQQK6PUigsd/PuU0hKtlks9Y p5LWQhGmDBKN1Pzy2Qgwp30ZTI5acAvCK2/M+Ywlxksne3cYOse9grdqvGa+3fKb9mA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CNA3pfHw; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DC1F606A31A for ; Tue, 1 Dec 2026 05:26:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CNA3pfHw Received: by smtp.kernel.org (Postfix) with ESMTPSA id B35811F000C1; Tue, 1 Dec 2026 05:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796102769; bh=nmMS6imKDWtvCUJQ8YMkUw6pCLyw7BDcB1oicbEyTGs=; h=In-Reply-To:References:Subject:From:To:Cc:Date; b=CNA3pfHwSz1Jg4eDdXR2Phx/QYY9BUzyWk2uToUs+rLtPCItpHb/p2BT/bwoebxby PZSn5ru4I+uPsevgpBDK6TiJAby9Y+or7a2OgBMPhrNHLm8SGCb5IVf9yRiNXMQVOp cmyGBZrL0MpdecntXeIjIcAlBVCcKb0lIrotBzqckv38ZTOsxl3vAXglUtL8iwiOS+ Ue/OoL6aCVGGZUh5nTXN4z2furh2rmoHDLpLZjZzwIwgHviNrm0FNsF2eZGZOJItYD HKphnV0UnSJSeOteNuWER9pdAn0N8G+U0ReMsyHAY7AkP9oIuumyNerbv7yrtmDOD3 rmLWBRytGut5A== Content-Type: multipart/mixed; boundary="===============3488788980454857510==" X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <8c8d5cddc8a026b1d93ebd558c8f1591c3949550243229727bc99e7c122fe0ea@mail.kernel.org> In-Reply-To: References: Subject: Re: [PATCH bpf-next v1 68/73] bpf: End the path at a call of a global subprog that never returns From: bot+bpf-ci@kernel.org To: memxor@gmail.com,bpf@vger.kernel.org Cc: ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,eddyz87@gmail.com,emil@etsalapatis.com,ihor.solodrai@linux.dev,kkd@meta.com,kernel-team@meta.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev Date: Tue, 1 Dec 2026 05:26:07 +0000 (UTC) --===============3488788980454857510== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit > bpf: End the path at a call of a global subprog that never returns TL;DR: Nits only: the "callee never returns" check is open-coded in three or four places with different spellings; the review suggests a shared helper (and using callee_subprog() in liveness.c) so they cannot drift apart. > diff --git a/kernel/bpf/fixups.c b/kernel/bpf/fixups.c > --- a/kernel/bpf/fixups.c > +++ b/kernel/bpf/fixups.c [ ... ] > + traps = calls && !env->bypass_spec_v1; > + if (calls && !traps && bpf_pseudo_call(insn)) { > + callee = bpf_find_subprog(env, i + insn->imm + 1); > + traps = callee >= 0 && !env->subprog_info[callee].might_return; > + } This isn't a bug, but the test "this pseudo call calls a subprog that does not return" is open-coded here, in behind_call_without_return() and in find_pad_code(), each time with a differently spelled call target (i + insn->imm + 1, idx + insns[idx - 1].imm, i + 1 + insn->imm). Could a small helper that takes the index of the call and says whether its callee does not return replace these copies, so the three edges cannot drift apart? [ ... ] > diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c > --- a/kernel/bpf/liveness.c > +++ b/kernel/bpf/liveness.c [ ... ] > +static bool behind_call_without_return(struct bpf_verifier_env *env, int idx) > +{ > + const struct bpf_insn *insns = env->prog->insnsi; > + int callee; > + > + if (!idx || !bpf_pseudo_call(&insns[idx - 1]) || bpf_is_unwind_goto(&insns[idx]) || > + bpf_is_jump_target(env, idx)) > + return false; > + callee = bpf_find_subprog(env, idx + insns[idx - 1].imm); > + return callee >= 0 && !env->subprog_info[callee].might_return; > +} This isn't a bug, but liveness.c already has callee_subprog() for looking up the callee of a call. Could behind_call_without_return() use it instead of computing the target by hand? [ ... ] > diff --git a/kernel/bpf/pads.c b/kernel/bpf/pads.c > --- a/kernel/bpf/pads.c > +++ b/kernel/bpf/pads.c [ ... ] > @@ -4801,6 +4793,15 @@ static int find_pad_code(struct bpf_verifier_env *env) > insn = &insns[i]; > + s = bpf_pseudo_call(insn) ? bpf_find_subprog(env, i + 1 + insn->imm) : -1; > + if (s >= 0 && !env->subprog_info[s].might_return) { > + /* the callee does not return: only its landing pad follows */ This isn't a bug, but this is the third (and with subprog_might_return() in cfg.c, the fourth) spelling of the same check on a call edge. Would a shared helper, something like bpf_call_returns(env, idx) in the spirit of may_not_return() for might_throw in precision.c, keep these checks consistent? --- AI reviewed your patch. Please fix the bug or email reply why it's not a bug. See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md CI run summary: https://github.com/kernel-patches/bpf/actions/runs/46579809730 --===============3488788980454857510==--