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=1796104322; b=w+Iaj8Ts+5BPjmtRcDYn737D9RDwSCN4RGBH2HyF2FF5Vr9YdU/UthWtwuPIcfNi+E1D imatBn8NEwZ5VCEv6xcqQ1vglBlB+kiCap4l2+79mn/8fTx6lGnUfDaRP4zewiX4lawn2 aEAf1Ht/Po6uxuQ9Evb8jK0okT+zX0bghtC50W/iZ0Ja2LBx603A6qCHIB4p38MR35eot glIiEEHBF+6OPRqCzVtHRNGW+B/wkkYQ8O9GDdYL6ZHzMAQVrYkRtcoEaGpUTqFk0R+ju pIfzlmC+9chiZcVbTeQF702SSCgJS45pDkKyPWJwD14BsbRlYZzr0MmSimmMWmoOEKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796104322; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=kb/Ephes1HfVYWWhwGJ5zpyTNUIuxKSJRk5EA+8lf6s=; b=RcQJeUhbx2PFjXU6rPuUsTntr23EGV3zidmM8aMrG++gAPth+8KC9vHe6a2/F/EAT5FN LCEjG1ySDmlNhl2gpPWywELm812kEy9D5V8WEjFokImYXKQZd2BwNEBMW02qQ5mF2cnMn JKhTNLSC0OVV8usS51VB8uG4dbkglut5Yy2VX66yGI7Z7R1ZV8wF9CVCgHyH1nu/InLDy nkXs0GGIbb//Nvh+0BYpE2mLwe/Jhyd5qT0XdX/m9txMbWNHG3lGd3jdADQ7fkeXUKxeJ QCM9tyFXHfGfC3kxMasatBgTqga0f1ElFgmtBSVKw6jD/szpYNYmHH6Zj/NAEg1X8dQ== 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=QRcHjeGO; 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 4E047606A31A for ; Tue, 1 Dec 2026 05:52:02 +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=QRcHjeGO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 116B61F00893; Tue, 1 Dec 2026 05:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796104322; bh=kb/Ephes1HfVYWWhwGJ5zpyTNUIuxKSJRk5EA+8lf6s=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=QRcHjeGO0eCPs0mtkz1p6soLqGmIwuXip5PHNrGvI7SyvPOn0aMzC4c+PEn1u+THL bzWBCiL16wuK+fbNBB6CjLbTYPx1ogUxXyMPjOKU6rI/cRIwF3Txgabcw0igRox/+V jbGtzVJaVYI5IA5sLKWV3B/pNko1fjYkN6IFsXZYiYKhXp06FYs53oepY1bYqV2QVX uFX/6H3HWalPamqH3sB+xCMs/20VDlHML3YmbsF6XybKhJItgOQ9SeivAR+d0n8NXJ UvieqNzp9jSTF/YLiDHwJc/Q8nZoaCMZii2FksWbRKDExP35NyvTNH3ov0UsYHkESt nj7QRLytFG7jg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH bpf-next v1 36/73] bpf: Cancel a program at a fault in arena Reply-To: sashiko-reviews@lists.linux.dev To: "Kumar Kartikeya Dwivedi" , bpf@vger.kernel.org In-Reply-To: <85a0e0f6e6efc12be58fd3a7765d8ff07ef58731.1796099737.git.memxor@gmail.com> References: <85a0e0f6e6efc12be58fd3a7765d8ff07ef58731.1796099737.git.memxor@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 05:52:01 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] bpf: stale must_unwind from loop guards in unwind_frame() rejects valid progs -- commit af6a8f2fbfcbcd96ae67354d19f5ed09116636d1 Author: Kumar Kartikeya Dwivedi bpf: Cancel a program at a fault in arena This commit treats arena accesses as cancellation sites so that a fault in arena unwinds and cancels the BPF program through a landing pad when one can be generated, or falls back to skipping the faulting access when a landing pad cannot be generated. > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > index 478fdc2d66424..07fdc4fc7ebcc 100644 > --- a/kernel/bpf/verifier.c > +++ b/kernel/bpf/verifier.c [ ... ] > @@ -22110,7 +22227,8 @@ static int unwind_frame(struct bpf_verifier_env *= env, struct bpf_verifier_state > env->pads_late =3D true; > } > sub->did_unwind |=3D st->unwound; > - sub->unwinds_for_sure |=3D st->unwound && certain; > + sub->must_unwind |=3D st->unwound && plan && bpf_pad_must_unwind(env, p= lan); > + sub->unwinds_for_sure |=3D st->unwound && plan && bpf_pad_must_unwind(e= nv, plan) && certain; > if (env->log.level & BPF_LOG_LEVEL2) > verbose(env, "from %d to %s of func#%d\n", insn_idx, > st->unwound ? "unwind_exit" : "exit", frame->subprogno); [Severity: Medium] Can a speculative loop guard leave sub->must_unwind set after the loop is proven bounded, causing the verifier to reject a valid program instead of skipping its arena faults? During pass 0, every non-rt_bounded loop starts with loop->guarded set, so check_loop_guard() pushes a speculative BPF_SITE_GUARD unwind edge where site_is_certain() is false. unwind_frame() sets sub->must_unwind without checking certain, and bpf_pads_must_unwind() only propagates must_unwind upward across calls without recomputing it after bpf_flow_drop_guards() clears loop_guard on bounded loops. If a subprogram contains both a bounded loop and an arena access, sub->must_unwind stays true even though the subprogram only unwinds at the arena fault. When that subprogram is used as a non-unwinding callback or called from a site with a landing pad conflict (such as a caller in nine RCU sections), subprog_cannot_unwind() or bpf_pads_settle() rejects the program with -EINVAL instead of calling skip_faults(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796099737.gi= t.memxor@gmail.com?part=3D36