🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #4204

[PATCH bpf-next 26/38] bpf: Assume no bounds for a writable tp with tail calls

#4204
From: Alexei Starovoitov
Date: Sat, 17 Oct 2026 01:24
37 lines
9704 bytes
From: Josef Bacik <josef@toxicpanda.com>

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 <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
 kernel/bpf/fixups.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/bpf/fixups.c b/kernel/bpf/fixups.c
index 002c3935a8eb..fe59e3114d82 100644
--- a/kernel/bpf/fixups.c
+++ b/kernel/bpf/fixups.c
@@ -2153,6 +2153,8 @@ int bpf_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.55.0
Technical Details
Message-ID: <20261017012451.364800-18-alexei.starovoitov@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347612-linux-kernel-netdev=dewy.ru
References: <20261017012058.355787-1-alexei.starovoitov@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347612-linux-kernel-netdev=dewy.ru
From: alexei.starovoitov@gmail.com (Alexei Starovoitov)
Newsgroups: linux.kernel.netdev
Subject: [PATCH bpf-next 26/38] bpf: Assume no bounds for a writable tp with tail calls
Date: Sat, 17 Oct 2026 01:24:39 +0000
Organization: Usenet Network
Message-ID: <20261017012451.364800-18-alexei.starovoitov@gmail.com>
References: <20261017012058.355787-1-alexei.starovoitov@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2935461"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:hF+Wrhr9sp2VdGtcYIum8wIhJPM= sha256:qeGXTJsguo7yQFVr+84O3w28v9XGFCpUKzMZqshFOjY=
	sha1:EshCIZDeXcD1XnrtI6BQnd7UKLA= sha256:SvAsY/qLfge/kpZ1gsFUfaiba/NxdyitePZakCp1R44=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 5B61611064F; Sat, 17 Oct 2026 04:31:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id p1hACDdIVn6p;
	Sat, 17 Oct 2026 04:31:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-347612-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id D52E611063D; Sat, 17 Oct 2026 04:31:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 6D1D83B35D; Sat, 17 Oct 2026 01:31:04 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0219A37E5D7;
	Sat, 17 Oct 2026 01:31:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SQwdeTSQ"
X-Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFA5719B5A3
	for <netdev@vger.kernel.org>; Sat, 17 Oct 2026 01:31:02 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792200663; cv=none; b=tNuahxoVotRpePDcSTa0vlgUJEZ5moACjeTqZB0T6tr9+HN80eQ+C65wSrbdwNNANnOjDN2mqzwQ6xxRcpdCEUxPXHJ7LBlCdEcgmCE3EpzZQLIB7cjiFfsD9D47Lm+amFVLhkMaVikLgRf1VcqxIar4wcDCIHJMamXhs47nzAQ=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792200663; c=relaxed/simple;
	bh=4CNEN7wC8Pe/7XrtPhrG7zkTQrJox5iMYzUoLmJvEaE=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=lkJ8n7714LK6XNvSrzlywLgF3KBJoB8Hi/utXg+bSPrLSmo4ngCR0G+hoCBT+PQAK/3BURS7Rk6YWN1yIqM+LLve2u+BHko7ca/+X0iv/+/MnaJzgIH+Jmo3ujDuohGEmWKTUYviaq+onJPKlDavasL84NHnLZGaNsQX3suxNqY=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SQwdeTSQ; arc=none smtp.client-ip=209.85.214.178
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2e934449bb0so3520375ad.0
        for <netdev@vger.kernel.org>; Fri, 16 Oct 2026 18:31:02 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792200662; x=1792805462; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=GNgrelxi6eEq7P7hlNUFtYxqdxmASU5JrfOLjioF/SE=;
        b=SQwdeTSQzRA22heA2SuxGQuMGMV+Jd66s4pBifNQbzYreWo70GJkixVzD7oc7Uycwu
         ogYmLgpu0D58vL24Q7Wi6wfZlYDfH2c0jMIRscG7do3NzAxsIixu6YHagt2x1I01G7QJ
         A5AcWlbyu2iEKXc4LnPyWhTDiLe8O8dNmNty3TttQVKFzQmrjQ33dBoSzVNxRL+qjfyD
         xmdD6KWjLotO8LCdche/8EZpckGhDohvezIazqINx42x/exTRoy9iQ8+iNe53Tn4t7/6
         k6qCF/GbW5YyHksAVr/LU3QTJi45beWcYN1fpJHYoKcTaXcbrtnLDDM4b0HMY7X6IwQr
         MxXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792200662; x=1792805462;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=GNgrelxi6eEq7P7hlNUFtYxqdxmASU5JrfOLjioF/SE=;
        b=lWxIfN7yjV7LUNKZes/gMjkHpRUY79UsVHcrCKxlKyWkCaTLHBpqgsaP9o8l29aqKD
         kWIiBuXbS3jPofccvhNAbYj6tBRMZA7WWkPXLiSuU0CGkFJgboHR++wbZXXTqQaePLl4
         5tfPR3J1qP2x9Xf3tuqbXNggp3VjF9HthlnwHJ/Gn9TRZI+301KPzvZNpfIWSVEMv9hF
         TIUDSZpItQzHRWo3VhmojbV/RQtKxWyCp32J2hB2qI4akNB16mravchAtmyoYas5H9e6
         hKRfNG3Kr9DxuqaBONyu61Wen6eWe9dOFA8+Mrk4Ptc/AoxECzKq0oij4euxwmZw6nWC
         s7Nw==
X-Forwarded-Encrypted: i=1; AKwUvBxyXpa7Z7ouMnuJXKIdN09K+4Xob4IZlTVZjbqjyF0awWMZ+eACZklxJ66HBLKJi5+j6lUT7Yw=@vger.kernel.org
X-Gm-Message-State: AFq9FYJrEFQsslgrPxj3ag9V+hm70knntIHzF7bmwuoS4QhL0nQEApr4
	RKv8OmHxPust4VWEE3BJ4SGxpwL9IxqxlagiGwTHB5Op3dxyeo5R/bvv
X-Gm-Gg: AYBFou0OGrfTzansCCBsWeK6XCKhfdMW0G0r8Fb80ykeN9usp4YMuyp8q6GzEZ6mO4j
	nGkhKeiQ0DwCPPOSPxCrN1BYw0a7bBTzTq/yneE2Ubvk3Arn4wQSmAm35K8z9eJ5+6ZMazU3z1+
	XxIpMs8WcYyHq/JD7hCfCeIQMVCLNypD78DGifGBuBAdhALVBXleW1wNKTHuG+xZ6TlQcSHRDcx
	n5y6u3dc180VunnzZ+58lu1XpTB89EDhgDKpg7vcHGe/VOgDAGwk0cZMD7GJvZxvpzya/oq6SW5
	Hx8iPx5DpIBBYYW0rXy7jXk82+N31FjkGaeiW+JSt5VLnseCQ1L3c8R4FnLaYhU/Gk3RKbd7w6J
	ef60iBHaFaZ510/8i4Jq7ny0rl0eUJFS8S17llkdWTvxzOTFRDrrCsc7qkui6e7ZhoEx4fQYlBF
	l7CazmpmT9Y+kxedt1vsBBFcPMnZ8MuuGbxetougcUh+rXka0hYe6O04f5du9VhmaDjBJWU3dKs
	1gpvA0+vo2CGu4IWa1O0bhFhzER+coqwvNtRb4M+JhYvD5OPIDfZJ2A0OuCUm+FwURNkAGROc7i
	6XE/ov7XWVorPjDfb1L78s7uDJpVEGd8XZGOGxgYOns=
X-Received: by 2002:a17:903:22c3:b0:2e9:9846:2da7 with SMTP id d9443c01a7336-2e9a68437f0mr16777425ad.5.1792200661870;
        Fri, 16 Oct 2026 18:31:01 -0700 (PDT)
X-Received: from coder-ast-ast-dev-ml-0.tail2dda0.ts.net ([153.61.198.243])
        by smtp.gmail.com with ESMTPSA id d9443c01a7336-2e97e87993esm17107195ad.59.2026.10.16.18.31.00
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 16 Oct 2026 18:31:01 -0700 (PDT)
X-Cc: daniel@iogearbox.net,
	andrii@kernel.org,
	eddyz87@gmail.com,
	memxor@gmail.com,
	netdev@vger.kernel.org,
	josef@toxicpanda.com,
	mason@kernel.org
X-Mailer: git-send-email 2.55.0
X-In-Reply-To: <20261017012058.355787-1-alexei.starovoitov@gmail.com>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>