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=1796383610; b=ICBpP1znY8XYO++4oTPPwXp97RJT2UqvkCQZ0H438XuXr6j/XzLJPKITNtaH+3U3Jgp5 6HzaUOv5PdGAmOB3TOIAK6K7oZim3lO7XWwDvY0PQSuPYNzPUedir1fSAKNoLYmdJ8oXK EAzMRrxXvMjqfsD5h7onX256tvHE+VZtJTVg59EIzxse1GB/BTYrNKJntkbF/PiSP560f 2jRGZkl8u9A3p+qpc0P+qn42TFfS5lk4j0xzQBke9rPiN8Fuhn7SbWlJtXGjLsPCzQdR1 HF6WLz3NYXT1aJY9PirznOP0/h51/G58Lk1+tmsvETePmU5w9+V2Gd2wM4+YZUe44UA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383610; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=+OyWthjePzbvxp1yIbUk4iig7ymzxPIk8bMoUVi+P04=; b=Du0bNoi8EuGxTBGalF4nDtbPzXUflP1uraZ2XSSS5wYj4Pt3BgXabPecGd4fooijU3ml 3bEwan4ACCmHhGWCOFfxO5OxiGT4UCM0NLg/i9clPrUt2/1cwc35SLlTvUdVwDxjUmGLa b3D3YLaRqEJu55c7eJDMNJB7nxBDSTJeNO+Sir4wq7kn6kYKABXdoYbgIG2Ei6R5OyECT kG6G8UboJjbfN2lymA+dXK7HWtpgnnVyuoYZvs7UiyBx0gvC/rJQYLx+C205McyNGstBv bmXo0+/NtlZzepM40rNx0NCLuKkgmMpQqgUDmWuVaqjNGcVjEHFM7qCmVS3IIyJUsoQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=QtYLomFh; 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 47231606A322; Fri, 4 Dec 2026 11:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=QtYLomFh Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1ECA1F000CE; Fri, 4 Dec 2026 11:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383610; bh=+OyWthjePzbvxp1yIbUk4iig7ymzxPIk8bMoUVi+P04=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QtYLomFhOVh+pu4wuDQ3SPy9PPje34z9vBhqb8hTHxAiHFvadclfglcO800JH6fi6 kbf9wpsSswYE1GT9lVYKoL3QK0M02YEBDjFQMIDhqGm+YCokyY93aYKNNUTlIy21bW HGg2bShAuu5n2YheDLqqBiBzHaa44Kgp3vbq58SI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alexei Starovoitov , Sasha Levin Subject: [PATCH 6.12 296/555] bpf: Do not fill jited line info for a hidden subprog Date: Fri, 4 Dec 2026 19:05:39 +0900 Message-ID: <20261204100620.428167179@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexei Starovoitov [ Upstream commit 2f2b119ea30dfba27563c1c939eb42b5298a391a ] func_idx of the default exception callback is func_cnt, and the test for hidden subprogs is off by one. The address of the callback goes to jited_linfo[0]. libbpf and bpftool refuse the jited line info of the prog. Fixes: 335d1c5b5452 ("bpf: Implement support for adding hidden subprogs") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-16-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin --- kernel/bpf/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index f94524481f27b..c6b2b43b843cb 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -226,7 +226,8 @@ void bpf_prog_fill_jited_linfo(struct bpf_prog *prog, const struct bpf_line_info *linfo; void **jited_linfo; - if (!prog->aux->jited_linfo || prog->aux->func_idx > prog->aux->func_cnt) + if (!prog->aux->jited_linfo || + (prog->aux->func_idx && prog->aux->func_idx >= prog->aux->func_cnt)) /* Userspace did not provide linfo */ return; -- 2.53.0