From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796061993; b=aEDXM+9Er4t8T/xVgEXg7qzLw4Ey4tulk+lfs39rcdbvl2jqCicXS33RyPIy4gwetEWP 3iKi9zI7UuF1aWZ+MYouyc2jmZiOA2SiSc0CmT/JOXrL/smeWLVz5RlPihzv5SXND6GPA dGFnaSEH6XabpkKDB4iqzZxikNl0Jv0pWFCScop2dA4JLZRcMtttn+UdZtb/+kV8ynFPm PQWw4TtsMHybT1vf5nVGYsKZHuH9I8fOLbgfrFeDf4ltQvA3YeDp6Kz58dqywZghp0Xv1 zjxb3WdaE2sOrsTI6bFjesY9Iz7eLPhcoh+BoBuArf1bf/zX/DZz7O2qZN5wi7A5+Mw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796061993; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=vqc9KCg9cm6XxH06SZhAOCq6qlFQdCKPKQ8F87n/gIU=; b=ItgHuaSmMVY1sYOzGkS4b/3f4GRsXaBe1qTneX/XTzSK4GhOu083zacVNZZ8WXI6Pj5B Vcml505l5YhogTKXfPkrSWIMy8rxfaN9pwt6tchAQfGOKyH5m3Mxm9mR4RP2tvTZx7R6q CrMd+R2HBpvG7AszlezflDCQwSy78XVEder+wH/zpCkxyAGFeRM375uL9v3ox0S0B5qDH jY5/9Ljsn9znE1VYzyHUCRRqz0vudtlJKiw1aJsinPAUULP2MxcWXx9HuX56OeVpprewZ Tr++ncB2pYBE4yejJgelr6yqCRBGQniO95W1nX0O85CHO3Bdff6QplWJXMJGtqZNwig== 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=N5pXnZlw; 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 D2B40606A31C for ; Mon, 30 Nov 2026 18:06: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=N5pXnZlw Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDBE81F000C1; Mon, 30 Nov 2026 18:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796061992; bh=vqc9KCg9cm6XxH06SZhAOCq6qlFQdCKPKQ8F87n/gIU=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=N5pXnZlwdGw0MlFVhL6nUq4AAMuEhRW3H/UfSkM7kYNEiKwoALN98eaGg6q1Mymco OFhzgQPUv3VfRwcXcZktlGUF4t0LFREq/pbroQOmk17dp0VJsqdlNBJPGI/Z69kHNv Gwco/rkuLLYMblrhT2TSNnuqHrRLUWJpDR1JMATGn9OjtV82l+KTJcS+VlWibPNaQa M+Hl1NWoxUt+d+NgCiLZjI5y0vsFThjE1Wm57C0W6MjQwLE927HgmwFF3/Nw3YxOgL TZpXg32/RwsAeCYf08wWvabIfbSKk8BJXmr0t0pqXOObupp/iZk04U3HF+/LKZ1HV+ QHPxJzQwzED+w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 bpf-next 1/5] resolve_btfids: Do not count errors translated to NULL Reply-To: sashiko-reviews@lists.linux.dev To: "Anton Protopopov" , bpf@vger.kernel.org In-Reply-To: <20261130180425.150703-2-a.s.protopopov@gmail.com> References: <20261130180425.150703-1-a.s.protopopov@gmail.com> <20261130180425.150703-2-a.s.protopopov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 18:06: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] resolve_btfids: transfer() drops errors returned via IS_ERR() and PTR_ERR() -- commit e1c82f8bb3175c33c159c6be7643d5ac46f3da7d Author: Anton Protopopov resolve_btfids: Do not count errors translated to NULL This commit decodes 64-bit immediate comparisons on x86-64 and arm64 so the fmodret scanner can ignore error values in a register tested by IS_ERR(), while still tracking -EINPROGRESS across the whole function. > diff --git a/tools/bpf/resolve_btfids/text_flow.c b/tools/bpf/resolve_btf= ids/text_flow.c > index d7d3f9d1c6c1a..44e772e2deb26 100644 > --- a/tools/bpf/resolve_btfids/text_flow.c > +++ b/tools/bpf/resolve_btfids/text_flow.c [ ... ] > @@ -156,6 +158,12 @@ static struct text_facts transfer(const struct text_= flow *flow, u32 i) > if (insn->kind =3D=3D TEXT_SELECT) > copy(&in, &out, insn->dst, insn->src2, cast); > break; > + case TEXT_CMP_IMM: > + /* IS_ERR(src) ? NULL : src. Count no error which the function tests i= tself */ > + if (!insn->is32 && > + (insn->imm =3D=3D -(u64)MAX_ERRNO || insn->imm =3D=3D -(u64)MAX_ER= RNO - 1)) > + kill(&in, BIT(insn->src)); > + break; > } > return in; > } [Severity: Medium] Does killing insn->src on every 64-bit -MAX_ERRNO comparison also drop errors that the function actually returns when the error branch returns PTR_ERR(src) instead of NULL? tools/testing/selftests/bpf/test_kmods/bpf_testmod_retval.c:bpf_testmod_ret= val_err_ptr() { int *slot =3D bpf_testmod_retval_slot(buf, idx); if (IS_ERR(slot)) return PTR_ERR(slot); *slot =3D 1; return 0; } When built with Clang, the inlined ternary in bpf_testmod_retval_slot() (idx > 8 ? ERR_PTR(-EFAULT) : &buf[idx]) is lowered to a 64-bit conditional select into slot, followed by a 64-bit compare against -4096 for IS_ERR(slot). Killing insn->src at TEXT_CMP_IMM drops -EFAULT (-14) from bpf_testmod_retval_err_ptr's tag, causing the fmodret_retval selftest to fail. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130180425.1507= 03-1-a.s.protopopov@gmail.com?part=3D1