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=1796104773; b=bA6W1IZnRvNHU+Ds3m06b86ia92WaIVGkngaiBOKEyuOn7D9lGBT4axTG3Tl1zTH9J0U gh2VpZy+ikQ2ivNO2ezhQDZ8TQ/cNzfs5OhdTAfXC9rnKEGMsMex92zhPF82orsLIg5AY pd8jwKe8p3rvMA8B39IFIGWT648DlAr/aeELx71dBLiI7fgWV1U+XqWKtaontP33Mg2g4 cz7mwv27Y0jzFY1G2nK3EvY++PnwRgiWopoD8ZPYHhLc6DiJR+/4GSmj+/Jz7lgaoyQZt 8f+rHhB+hU3W0RAxTMvwS3FwTlZnX0Goa5MSZXPF3uUHExS31ZZy7AVRAIc3mMxO5mg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796104773; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=RemogzSWU09QbkuaIxlcHvbbx1OnVSxutC+6fJaOXao=; b=ZTM4JHtLgX4pgowwVbNK+wUbZp3CiLybhUNrPLnqvtNOCj0kkZObcKQ+Wj1TZjoOzZRt KXEkjFkwFurv4w2s31thZ8E7E8Rt1m7vUNW4lIU1930/jAIFYceqsSsFKr4LsF6JUc7R6 14cOD/zOr4twJ/jyM6YYBZLwYmjXizdcfezMFVfKEUmafp4FTBZUWp0gN/QzJscH4aFY2 i7qBxuWv0HuekwG/xaOfr3fBSazstBd+/6UL9LyazEkzlFTvS9B6FNgHPF6zIAAcUXJkm 8Qpl2/oAucYKYiigFf1I7pD5r32jKMkOneyEP7XJ273H5ja98Ej67m7e96B1RbZrD4w== 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=laPSSNZN; 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 610EC606A320 for ; Tue, 1 Dec 2026 05:59:33 +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=laPSSNZN Received: by smtp.kernel.org (Postfix) with ESMTPSA id C90391F0089A; Tue, 1 Dec 2026 05:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796104772; bh=RemogzSWU09QbkuaIxlcHvbbx1OnVSxutC+6fJaOXao=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=laPSSNZNPZMlThpZu72FDryRrjW8o8T1sGVZBwLXsyrPZhk3iqFc4up5Mh/btkR44 opBaHUYoeKwZV8iMHLwe4Szu5vtTorqwY5hjzdy/maVNE+gK+eUcaCFSOzJvFn3rGl HiyAyzNxOGos74kTQQOeqmbU8YArPMRHsPQgxqQ82scH3Gdq1wjGkIVCLJzJTtLqd+ 8Y1wM4+VvfOt+RD16gBEhWD86j6ZjHOK3vdBwuFAIh5gcOUujl8hEOgxqCWeBAQaxB 0W94e0AdR2ypODPHJ18p/eTHyS4AelXiEDx0+FNm9V2bpxFb0KmVex0BBckI5Kle/C G4lwtrR5qIhZw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH bpf-next v1 69/73] bpf: Tell struct_ops when a program was cancelled Reply-To: sashiko-reviews@lists.linux.dev To: "Kumar Kartikeya Dwivedi" , bpf@vger.kernel.org In-Reply-To: <180df8546fd4e33593235d9d7b327b34ed251768.1796099738.git.memxor@gmail.com> References: <180df8546fd4e33593235d9d7b327b34ed251768.1796099738.git.memxor@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 05:59:32 +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: kCFI type mismatch for bpf_prog_report_cancelled() in ___bpf_prog_run() -- commit cf3d7ebee94b1cbdac15f9abb53c54a200da8774 Author: Kumar Kartikeya Dwivedi bpf: Tell struct_ops when a program was cancelled This commit adds a ->cancelled() callback to struct bpf_struct_ops, emits a call to bpf_prog_report_cancelled() in top-level landing pads, and holds a reference on the struct_ops module for the lifetime of the program. > diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c > index 288963919afd3..588800956bead 100644 > --- a/kernel/bpf/core.c > +++ b/kernel/bpf/core.c > @@ -4138,6 +4138,18 @@ u64 bpf_prog_report_recursion(void) > return 0; > } > =20 > +/* > + * Called by the landing pad that ends an invocation, when the frames ha= ve released what they held. > + * What the value of an unwound op means is up to the struct_ops. This i= s the context of the > + * program, with the locks of the caller of the op: see what ->cancelled= () may do. > + * Only programs of a struct_ops that has the callback call it, see bpf_= pad_insns(). > + */ > +u64 bpf_prog_report_cancelled(struct bpf_prog_aux *aux) > +{ > + aux->st_ops->cancelled(aux->prog); > + return 0; > +} [Severity: Medium] Should bpf_prog_report_cancelled() be defined with BPF_CALL_1() (or mark prog->jit_required =3D 1 when emitted)? A struct_ops program with an unbounded loop guard (BPF_SITE_GUARD) in subpr= og 0 can emit BPF_EMIT_KERNEL_CALL(bpf_prog_report_cancelled) without setting prog->jit_required =3D 1. When net.core.bpf_jit_enable is 0, the program r= uns in ___bpf_prog_run(), where JMP_CALL invokes (__bpf_call_base + insn->imm)() through a 5-argument u64 function pointer and trips a kCFI trap on CONFIG_CFI=3Dy kernels against this 1-argument prototype. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796099737.gi= t.memxor@gmail.com?part=3D69