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=1796382095; b=rxXMHq4kPCv5xDK8lcdFjfen6ZyIzczxZqpV3VkPHiirf8k0+VZ3cdNTkWyxAXgCwAPW k1SX3iJKN/InN+t/mJKD2zfSGMRtAXnqvJ1Kbul5EyCD/0st41MbXO5SjJScuUK2/Mvp1 hQIXxDt9uoIa5EbdQQu8IoR63/Tk6tZtHspWFREEOdHnP6kzNcMVDtxGVuU91dE+/dgY4 Jc/9LdvdCHbih8a2p630QrdIf4AtMp6ZCkxd2I8v56OI+KtASrT51hPNQjXD/J309KxsC 1eahZswhw0M229nfzGkSUhXZOfgK0Q7Gp4WvMQxzlONM+Gn35CVuWYyrOZ224Pp4m5w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382095; 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=QjFCuuvqdK0g5l/umylvEPrlVqDN88LNA0ABIRxV4Ig=; b=NM8SGxhFvAekvj+Sv8xxe22yczIJsiEdUfQkLemGrM2lquN/LRDDJW+I6SYxfLwMfug5 E1gHYkpbva+gmdNDad2e5jG/uZXuoCDbGbnVCRRzRUSoyg5Q+CeqSWV2aT9z6V6X+za/m Q3w2xuHE8cCxMMZ765SAYwh2LBI7GTqY8mCRPt9s7DwyXalsAUD09opm6VccrtmsACntt xBmqTstWwKUiXjPli+TMnfqzzDS15qK+px9BkPgzTrh7uhcifLb7/q1yPT61hBWFQpswa WjJfo7FxTEtIUma+uhqaaV0Vtt/nYhmKMvr6YGR0wcz9ue81b3qQfRKG+5rO/yun9nA== 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="bMgi7/Jb"; 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 5B393606A322; Fri, 4 Dec 2026 11:01:35 +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=bMgi7/Jb Received: by smtp.kernel.org (Postfix) with ESMTPSA id C71831F000CE; Fri, 4 Dec 2026 11:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382095; bh=QjFCuuvqdK0g5l/umylvEPrlVqDN88LNA0ABIRxV4Ig=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bMgi7/Jb5lXVxnt0Vbf/ujoj5LVmGgEGipWi4dJLQajJSZHxCmrXNZTGWHjJlLWVe ku/1SZIVEk7k41SHrIV+h1u55DRWbAp5Z8YyNkhMGNOBu3yNpZe8CSAjG2snhX2Nt8 fBbA7l4SJIUzfXkut9EzTFl5hyrEcE2xs/14p3Og= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alexei Starovoitov , Sasha Levin Subject: [PATCH 6.18 305/703] bpf: Do not fill jited line info for a hidden subprog Date: Fri, 4 Dec 2026 19:03:24 +0900 Message-ID: <20261204100635.888365566@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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 1d1d834482228..14d468049b6c2 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -233,7 +233,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