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=1796385131; b=aes6eCGJ+6bd5/0qGXaOomVje03yb0WNYPQi4Ay5umW4u7HGrymHqzxLwD4fux0TCfTl +LK4m612CLsiK4bRQkeSj/muUHmE3ZAMouCfNruo/EycwWWSFBcvX+RCoiHwOHwVKdA62 1HJswDyaOa8E4L4K9hHwssUiBcZ+2Qg6IKCWs5fPc1czAlDQ/yVv/HrZIs6WFkffg3iNj WjC/pnrclgozhzjbDjelj/LWjRlEOXHIPdoFBFFRR4DJhl9KF02IjbA5Ztf3ckkGAqOhj MJq6nA0Bqf8AfRWndc1xnz7lIaPNDl6yBRuxM96vK0urWQ+ayAiePq9MX1gRQVbuEzQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385131; 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=uFGo0UfLwBM59SBip+XssrJWdana+Ib5nLFkpJT+v8s=; b=w5s0FqufY+afIfZdShNYpIExDDqewMCjiFMG6foqdO5y489Ah5sBXaRJ2UTT5Nz0qTKo yFcrJQZB13CbuFzLUmACMwYj8LZjh6UcAKEdsD2Z+UTerI9hcj+Kw4sMGdPuvvuk7a8Va PsOY4pU6B1sJr+uZV8vl31HIYV8Lfs7Z4gfKn1GnXM75hmiaywQqt615AiU8CTOQ6bCym E7phs0Nhx/yuO/pme0Kxjy0O0FK2O2sd5fK3qvN+7hXAnWk0TLkccnTfnLEG09hSoeitn jahFhc6nBNF9ZdqpVosxfoxSv+YLOWE51wJsXkHTtMgJZleFkMh47N7tKb1tU3bTAMQ== 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=jQTKcnFV; 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 8080D606A322; Fri, 4 Dec 2026 11:52:11 +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=jQTKcnFV Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBDBB1F0092C; Fri, 4 Dec 2026 11:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385131; bh=uFGo0UfLwBM59SBip+XssrJWdana+Ib5nLFkpJT+v8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jQTKcnFVQnFUUwmq19xBSiXgDF6eSoLDaTb5zEr4JkvdS+0/+ZPGLSrXl2sIfRTaP jxd066qO/ZD5YJ3XFrwzt+nE3jCADoT33JFIlgRAvp1Kyj5ZMn3IbTglDsuYPzsJbg 7t/kE7Gf1I3lRia3mJuTIXNWAJ8VoNBrEWd/GdTo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Josef Bacik , Alexei Starovoitov , Sasha Levin Subject: [PATCH 6.6 0431/1167] bpf: Assume no bounds for a writable tp with tail calls Date: Fri, 4 Dec 2026 18:57:38 +0900 Message-ID: <20261204100713.244193704@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josef Bacik [ Upstream commit cd0490e671d70326d70c7d36e82388939fd9b071 ] A writable raw tracepoint hands a buffer to the program. The verifier notes how far the program reaches into it, and bpf_probe_register() refuses a program that reaches further than the tracepoint allows. A program that does not touch the buffer passes, and can tail-call one of its type that reads and writes behind it. Take a BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE program with a tail call to reach as far as can be, as for the stack, the packet and the buffers of iterators. It cannot be attached any more. Plain raw tracepoint programs, for which the limit is zero, cannot get at the buffer, and a tail call stays within one type: they are left alone. Fixes: 9df1c28bb752 ("bpf: add writable context for raw tracepoints") Signed-off-by: Josef Bacik Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261017163745.3341787-28-alexei.starovoitov@gmail.com [ sashal: adjusted the tail-call fixup to the older file and function names (verifier.c, do_misc_fixups). ] Signed-off-by: Sasha Levin --- kernel/bpf/verifier.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 8d60218344b4d..39f3e2aea0d9e 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -19550,6 +19550,8 @@ static int do_misc_fixups(struct bpf_verifier_env *env) prog->aux->max_pkt_offset = MAX_PACKET_OFF; prog->aux->max_rdonly_access = U32_MAX; prog->aux->max_rdwr_access = U32_MAX; + if (prog->type == BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE) + prog->aux->max_tp_access = U32_MAX; /* mark bpf_tail_call as different opcode to avoid * conditional branch in the interpreter for every normal -- 2.53.0