🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16827

Re: [PATCH bpf-next v3 0/8] bpf, sockmap: Restrict iter-context sockmap updates to sockmap iterators

#16827
From: "Alexei Starovoitov"
Date: Sun, 15 Nov 2026 23:26
38 lines
12671 bytes
On Sun Nov 15, 2026 at 11:10 PM UTC, Michal Luczaj wrote:
> On 11/14/26 19:45, Alexei Starovoitov wrote:
>> On Sat Nov 7, 2026 at 5:58 PM UTC, Michal Luczaj wrote:
>>> Follow-up to Sashiko's report [1] and the decision to restrict which
>>> iterator may perform sockmap updates [2]. Series started short: remove
>>> about-to-be-stale test, restrict updates, add a negative test. Then it
>>> expanded: mark bpf_iter__sockmap::sk as PTR_TRUSTED, restrict
>>> bpf_sock_destroy() callers to iter/{tcp,udp}, few little tweaks.
>>>
>>> [1]: https://msgid.link/20260626205814.BAC3C1F000E9@smtp.kernel.org
>>> [2]: https://msgid.link/87echn2fhd.fsf@cloudflare.com
>>>
>>> Signed-off-by: Michal Luczaj <mhal@rbox.co>
>>> ---
>>> Changes in v3:
>>> - Drop RFC prefix
>>> - Update bpf_iter_reg::feature docs
>>> - Fix tcp_request_sock BTF build error
>>> - Restrict allowed callers of bpf_sock_destroy() to iter/{tcp,udp} (Alexei)
>>> - Link to v2: https://patch.msgid.link/20261102-sockmap-update-limit-iter-v2-0-e96a63c43b39@rbox.co
>> 
>> Sorry for the delay. Applied.
>
> No problem, thanks.
>
> To follow up on bpf_iter__unix::unix_sk, looks like there's a single helper
> that will become unusable from iter/unix (once plain-PTR_TO_BTF_ID is
> gone): bpf_get_socket_cookie(). PTR_TRUSTED then?

I have a patch that 'forks' bpf_get_socket_cookie() into two helpers.
One for trusted and one for untrusted.

Also have a patch set that removes legacy ptr_to_btf_id for good.
Hopefully will send today or tomorrow.
Technical Details
Message-ID: <DMW695ICRVGM.2YJJUJQ12T0V6@gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363913-linux-kernel-netdev=dewy.ru
References: <20261107-sockmap-update-limit-iter-v3-0-7c0bad1ad036@rbox.co> <DMV5NLOEYFGF.C7ITHCRCNA7P@gmail.com> <e8f1736e-3f13-4f92-ad69-8b166c41e68a@rbox.co>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363913-linux-kernel-netdev=dewy.ru
From: alexei.starovoitov@gmail.com ("Alexei Starovoitov")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH bpf-next v3 0/8] bpf, sockmap: Restrict iter-context
 sockmap updates to sockmap iterators
Date: Sun, 15 Nov 2026 23:26:38 +0000
Organization: Usenet Network
Message-ID: <DMW695ICRVGM.2YJJUJQ12T0V6@gmail.com>
References: <20261107-sockmap-update-limit-iter-v3-0-7c0bad1ad036@rbox.co>
 <DMV5NLOEYFGF.C7ITHCRCNA7P@gmail.com>
 <e8f1736e-3f13-4f92-ad69-8b166c41e68a@rbox.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1929608"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:0FzVOcYYTSpWEueXZp5wtJ839Zk= sha256:coX4toSPD4bDMEAhGkqOKA3NzdL7L10GeRgIPz0+HaI=
	sha1:XP4sdGAxi0o3j2UjldOrR/blk34= sha256:JilfnwD5vjQlyWiA+PBmsjzDa8Xmel65LNpCsDl4ue8=
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 D757C114A93; Mon, 16 Nov 2026 02:26:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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.249,
	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 2y67AZR6qQXz;
	Mon, 16 Nov 2026 02:26:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363913-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 EF3B4114A52; Mon, 16 Nov 2026 02:26:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 6386A2EAAD; Sun, 15 Nov 2026 23:26:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794785202;
	b=U4rE64AbYW7sVTd23N+58Y1ZbQaSNccScFa1P95t0MpIkRx6D07xQSS65mGSiHd3dZlv
	 hksolCNtfryqQyY7JFKxJFFB+0D2DD1d1dhAHOS8qMrBopD6sZE9cHizNpR1zC5qYnODU
	 pcfPEhgB0iD33V3a56H5+Me3ok/rvDJrUfbf+dy9bDOfCLlsKO60ojpahYfgmaH/pFR+S
	 AVUl7x6hAyKIoWJIt31cdN9oTtBe0KzpYwmcA00+QzBGnx7K+oTQCBSz62+0BqFx6T60L
	 Kfofod8FfPB8iJsFlh4gFtK+iugoeRQQZUdBZ/cTMk4mQ4QzkThserl37ZJu1yxs4Mw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794785202;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 Mime-Version:Content-Transfer-Encoding:Content-Type:Date:Message-Id:
	 Cc:Subject:From:To:X-Mailer:References:In-Reply-To;
	bh=20xh83TZY5Uy9+3Rpue534EqUQXyz0SBbzg5tu3uVBA=;
	b=yVIKNt8KU1WYk0GS0NUT11tNeBf+t2mtmg63vlEVH1ifYpIoUFBcvE7H1hYTfa9wFWM0
	 Za9UZDKAdDCHgeMIM0JEy1RjBK/DPU7DnHqy6KZ9/2a29NVklwRleae9FuO2xKA3y26Bt
	 ccoBT3zAp8qpcWlGNolpoh2QRDdaVnMMCxy/95qMaR8kaOHNfW1kkjyvkGegMynl1pTCt
	 a3PvoTVD8IjZUEg+thUayQE+xE/r0An7q0FrHVvpPX/Pp2ILj2Qe7xAKNxEBZNIuNGsI3
	 pdGqm1PecCzMoUNFpFx38ShosyXoK8VBe69xG7vkoFBNOShnkNkUPS+svTIj0KuqJ7A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=gj10Swzo;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id E34CA606A884;
	Sun, 15 Nov 2026 23:26:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=gj10Swzo
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.175
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794785201;
	b=RBEIUNgwpGlis96vRYtIU8l20GwIuunNXCOMS7rCbjTYbzsx8yx7mTMa+uVq0ob4W9P6
	 M3sQYVDsHTmSyPBYpPNpb2NlE4oLZDvacEtRM8Iuc5rLlrvg/mVTsv3DcFZzPQYeS+Sxb
	 eSiLeczkm1Ytk+1Cj+O51o+RASu5i/q/waxKjQ323RK8I6HISz8eaehAouinUn4lEsT3n
	 hvz5f3JyeuD9QAL/GfELqVphPco31aKfi5DOpP55WNd7TEQOx3oAYvuEx7cKNFnBn4UT2
	 p/fQzDrgh15pPRKYDpI0y1w+rdKBfX9y46QugzpTFduIL/JFtKvMpLWIDDcTsJSrnNw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794785201;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 Mime-Version:Content-Transfer-Encoding:Content-Type:Date:Message-Id:
	 Cc:Subject:From:To:X-Mailer:References:In-Reply-To;
	bh=20xh83TZY5Uy9+3Rpue534EqUQXyz0SBbzg5tu3uVBA=;
	b=pRAMGyA4rExNgjsXLik2kH6L5iCI/X86GT+eRM4ygiIQEQNJf/7No3PEFI1TMSrI5nC3
	 OORL8d9DK4Fe94HcMoYOyXunUyhi/drcScOSkRfuwZOVlSP6riOWzh5rLUK0fL97e4aWs
	 QL1NAxI+6P3IkyC9JvB9CVIhU/eYzsXSl/sPCPl32BkmWOJCSeo9c21NQgKbWbseve3SV
	 IqmNzZWker2jTcrGNCRKaYJuZYgD0zgsH9HGmLgEOYp+PPNbMepYmIVj6i86bTVHqwyQk
	 iBS2W+a+1TRAQa64J6gn7w4hXgXTa/AaCuzyEOvvl0/LPDvN+x4OMO+fVMp3rmd4+wg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=gj10Swzo;
	arc=none smtp.remote-ip=209.85.215.175
X-Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E34B606A329
	for <netdev@vger.kernel.org>; Sun, 15 Nov 2026 23:26:40 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3E34B606A329
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-pg1-f175.google.com with SMTP id 41be03b00d2f7-cddff772fffso91378a12.0
        for <netdev@vger.kernel.org>; Sun, 15 Nov 2026 15:26:40 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1794785199; x=1795389999; darn=vger.kernel.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-type:content-transfer-encoding:mime-version:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=20xh83TZY5Uy9+3Rpue534EqUQXyz0SBbzg5tu3uVBA=;
        b=gj10SwzoKMqoqx9yr7X2Fju4cNBju2Oqd5X0Ay4Y61hHfD7PCDp9yiFRZZggUUCphi
         EgquiXzLIx6aY4R2RTd5ZLyzF7a+dFyArlFGpwOF8hzIuQxpoF1rvqBPTA90bbQtiSc3
         ZX0RVckXRZHz0dFR0n/+vn5BPOC/cB4YcRGnL/oyILEIke66Jod48SG+Qv5PIZtk+cJ3
         a4jGk58g4rcuy6H/nHZi7pTcKmRSJIlcgRxeZ8a/8BRn14ucVJyS4iEkzUGGbVSfsTxE
         PA1L6L9cE4UDQma31GznSkYOnY4WfVQEo52nxdxOSnQrrOnmbWew4sNB0BE/xLjNWEuG
         NuZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1794785199; x=1795389999;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-type:content-transfer-encoding:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=20xh83TZY5Uy9+3Rpue534EqUQXyz0SBbzg5tu3uVBA=;
        b=IxyCkssBarpIuDEvXQHhb0gGXvzOPz4wAYqPY6y6GHpl/RFEpnq2TGqb8jRsgPo1jb
         M0AeYmWhU5EEaAP2w2UHk1k/nOA3gZpAP+Q+nMivYhDtLkvBfL+JyA8YP6UAUCPvZmU/
         OdLZYFMxq8yrkTuc+faf6elqMkpceG74wVuqiVvz8ovoWp0EC6nw4oxYlJEuV65mnyTc
         TP/1ZLH/sZVQYre6NepDoNTCE7qZdBFYvLzvJ3seDGVOyRSbHI4PNTablt14G1Z6f0aJ
         wrz/K8IaYaKpxHYrMxIdF9Rqi9U1mt0T9+Csm8DC9rG6UZyzRsoFJT38kR8bow3ukJEs
         U1wg==
X-Forwarded-Encrypted: i=1; AL+hErGckDi3bdNyWo/0BFPVecfRg+7FI8Fp/9z9wyJbOI1Q4Hj7bWyRrZ4kOVxglE3Eiqz3pUUytOU=@vger.kernel.org
X-Gm-Message-State: APuU4Z/Rtaf8wpaRGkN9L8scF3kN8kDQgu4zRmnYiqAdQ+eKntCsHmnh
	6uktD2btpnTwu9iKIU/4W97VobYReURXuikJhXN1ebxUFO3fVdhGVWCU
X-Gm-Gg: AYBFou1sPPCQVmUQPDXQNLS+tXaWz4Jl3o/3APY3l5aPvgFi1uyHxYC1jrgMHgQGmR2
	vmqNEj2/LfCMeqe8eSOtU3m4xerU8f0ibwcaxsJjteAw9adIEbSF1SxxI1saRoJA4DML3XHbN6n
	TxERs5U4/TmOimyccU3YquWO2eJVed178wJLLXWfZOZi7GE7U5uP+mrdxZonS59JEH8nBxisR/F
	D+gJnPDwm/H+R2wNt0GGQQhqWcRUpwoKyl4uAM2PFuVLpcURir3sOZ2Sj4TvsFi6Gl+kzXYbR8t
	JUJKUjXt3z9xyccEuWjeJPprsXKluELZi7JYkEteKeC5+HuIs1dx9pkINaUDUpmAZbGXGtucq+/
	IQsDyQRBYCS/sN/cWQTv8+/vwQORlajgupWcvfUO9eUTu1pmI/XvIOEZFzIGvXaQaXJLgfCeKFV
	jYu+sl5EiYx39ZywXQezI31NNwMdKa5ZUAUxgX1zQWTb+P7/OfoTIclahBGBtWeRwKipEqxUgiQ
	G4PtHmHjgswNqShfJorC5QgQw7NIKWhOnHFd8x5CPZmxsTPKiuVDOUML+oUInovRwdVv7llToU1
	rpwBo5b2/AwHTvDU4tinqJENtbi78LabMLpOjyCrrXwPOy/GUTNW3B41JZHS2N6c8CRbw2C0lD2
	4iXp1RtBx/TiX9KHjOrZUivy1KpC0sib3GQ==
X-Received: by 2002:a17:90b:2e06:b0:3ac:8897:7bab with SMTP id 98e67ed59e1d1-3b1b07e1cd4mr8163612a91.6.1794785199420;
        Sun, 15 Nov 2026 15:26:39 -0800 (PST)
X-Received: from localhost ([153.61.198.241])
        by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b1b3f09b92sm6832094a91.4.2026.11.15.15.26.38
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Sun, 15 Nov 2026 15:26:39 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Cc: <bpf@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
 <linux-doc@vger.kernel.org>, "Sashiko" <sashiko-bot@kernel.org>
X-Mailer: aerc 0.20.1-355-gf870624f6c37
X-In-Reply-To: <e8f1736e-3f13-4f92-ad69-8b166c41e68a@rbox.co>