Article View: linux.kernel.netdev
Article #16817Re: [PATCH bpf-next v3 0/8] bpf, sockmap: Restrict iter-context sockmap updates to sockmap iterators
From: Michal Luczaj
Date: Sun, 15 Nov 2026 23:10
Date: Sun, 15 Nov 2026 23:10
30 lines
10213 bytes
10213 bytes
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?
Michal
Technical Details
Message-ID:
<e8f1736e-3f13-4f92-ad69-8b166c41e68a@rbox.co>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363904-linux-kernel-netdev=dewy.ruReferences:
<20261107-sockmap-update-limit-iter-v3-0-7c0bad1ad036@rbox.co> <DMV5NLOEYFGF.C7ITHCRCNA7P@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363904-linux-kernel-netdev=dewy.ru From: mhal@rbox.co (Michal Luczaj) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH bpf-next v3 0/8] bpf, sockmap: Restrict iter-context sockmap updates to sockmap iterators Date: Mon, 16 Nov 2026 00:10:03 +0100 Organization: Usenet Network Message-ID: <e8f1736e-3f13-4f92-ad69-8b166c41e68a@rbox.co> References: <20261107-sockmap-update-limit-iter-v3-0-7c0bad1ad036@rbox.co> <DMV5NLOEYFGF.C7ITHCRCNA7P@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1924662"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:NKZbXzTG350hqeNdjl9OULrMvng= sha256:jeBWBclHgmaoarbN71biSXx4evPC5yCfIOvwOZb26kI= sha1:uBCWtmLJAp/hdn9ooqU/1viqpWY= sha256:/dgc3XEMuKTKb5GK8nxtSP2TQ109+2fn8EDTLyvK4LM= Content-Language: pl-PL, en-GB 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 2F839114A9A; Mon, 16 Nov 2026 02:11:17 +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=rbox.co 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 rXv88Kw5iafF; Mon, 16 Nov 2026 02:11:13 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363904-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=rbox.co X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 04DBF114A97; Mon, 16 Nov 2026 02:11:04 +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 EA9532E902; Sun, 15 Nov 2026 23:11:00 +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=1794784257; b=iu3MQj7gteSWotvzXYPg25f2QFPDRPfkwpHIuXA4nu5r4fs7MSM0QDIxGwcjk+OFuSKA cyuXQ3uV5gKKwicrTwcyDzy0Bo61Ry/2U5u1t75SRFMx5Yaq1QuEkIgRPN73kFXXnC1Ij r38bfp6s9kTIQX/3trj03/uCXk5TtxR9BsdaRXbwmwcXyYaamWdDx5Rw0o5uOWgvCjfKP KUqycAQ6jQqowq08I3ec6YSdRf74020TsNmyLOLsc4fB8dVKrjh9mXx2rfcGaPBh5FaRu Z9MlKhBvQLj7sI/lMYSQVWCqQcLKVnIaQQuQOuikT80OdB8JIlcWC5zn/bp1mHnxF7Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794784257; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received: Received:Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: User-Agent:From:Subject:To:Cc:References:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=Y2c4GuntC+J+u1XdIe8/YlwOw+mNu6OQYE3WM0aA4Sw=; b=B1LbCA8mYxy6nDbA8q/OkXmLrew1N9aMpAdiND208/R5s6Jf/YdFVpHkPZ7V+q4OfMh2 /A3NlOipKcz58g6sBsUkAD+GqDYEj8Kz3tMGCqHDrRzd4mmuV6GNywE8O97xq+etwPqGm fbyZewIh6WJ1KXUVqxDXLzzIiiKdecyKVSwdWEUGAJ/x7L0p7855+FkNMQqh7dZventb1 rls4/x3tSpchzGIHOkOJrLsgJW4WCyWkJYw3smPwbyFNKNaPTYjHvEpeWCJGrcGr+E6ed 4lMG/pQ9oH/UaLx1EG+VKWPEgkBPXWwvI63rmQ/Vc+2p7C3ZWVlv1/N7GT30OITbhsg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=rbox.co header.i=@rbox.co header.a=rsa-sha256 header.s=selector1 header.b=Y5kqtfjb; dmarc=pass header.from=rbox.co; spf=pass smtp.mailfrom=rbox.co; 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 3C1F8606A893; Sun, 15 Nov 2026 23:10:57 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=rbox.co header.i=@rbox.co header.a=rsa-sha256 header.s=selector1 header.b=Y5kqtfjb X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.226.149.37 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794784256; b=QiyQhwEdWC/OGnPoIWxHFhNaIPdDkpit/Vsdd3ncED5O5BbPs9UaUOHb5Db01VQsiUwE UY7H4gAAfA4tHURXH0Z+wObQBb6f2d1/nhryfdD+SalFAqcea1gDEw5WD3p/W+w3WJbiB enkjoEjvaubui6/lDHYUGN8SokvpcxHS4XSMThxo8mwSbWV3q0rXfq5OPTR37ZA+f4SHI 12hFPw1PhqTeIBiK9/7d0xu4ioDfeIN4BvBWMWgetHq8/2Vf7pBhoF2ur2UEShyd0OZbK FkwH7XEWi6+gBd9cNZcKnb8JMQV9gryQoJiditwY59z+9U+9rZMjFbA25C4OZ4Io8Yw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794784256; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Message-ID: Date:MIME-Version:User-Agent:From:Subject:To:Cc:References: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=Y2c4GuntC+J+u1XdIe8/YlwOw+mNu6OQYE3WM0aA4Sw=; b=3N8+VsKKD0dI/5I45yI00ajEQ/UAtmPVxM7FAnVyPNHf7wAzM7GGmTAG4adMy73NFZAE tVzOOW2hrvlRcIMtXpE7ilwjO8fyqW4DZ7q7BOCsIaEkrVnjXyDvvJt57ttUSoc8hKpQW Q1wXzf+56bY86fsqyfk+YrnLQ57K7BSfI8z4NYxx1o+GpVnKWXe2W/zGxFixiregtamP5 ZvWhEPf4zmKyT1O3cQjX1cTJrah+PA1Hp4Lc2HngKAQit5UhdkUwh+orK0RfwarfufKzZ eqhCxX5ABh1txzFhyEAxCJ9i93EPD7T16VBOxe6yOpnY9etaLehJbJqAqejqhd5aBAg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=rbox.co; spf=pass smtp.mailfrom=rbox.co; dkim=pass header.d=rbox.co header.i=@rbox.co header.a=rsa-sha256 header.s=selector1 header.b=Y5kqtfjb; arc=none smtp.remote-ip=185.226.149.37 X-Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [185.226.149.37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF37B606A31F; Sun, 15 Nov 2026 23:10:55 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DF37B606A31F X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rbox.co X-Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from <mhal@rbox.co>) id 1xSjMb-00EbLr-OF; Mon, 16 Nov 2026 00:10:21 +0100 X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rbox.co; s=selector1; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References: Cc:To:Subject:From:MIME-Version:Date:Message-ID; bh=Y2c4GuntC+J+u1XdIe8/YlwOw+mNu6OQYE3WM0aA4Sw=; b=Y5kqtfjbJEBZsunJyvYzYSuOKJ x4GqsvQFHvgz6aMwDH35pjfmNTCxYUppfB+rnK63mUjpLQWszSGSzqnWenkREZ98QWq0quF1sByHE ZlzY9j6508J9K+z3CGvJvjvCdIzjVKa3UoLSnstBqpQQ8BI7ggksAIB/AsGYhWiB2s1S+46SThI5s HeuMc00fyAyAt83o3Qd3TJnKjU6o7Or5v+fBiLyGEeZ1j5sb3tSOVFUqwp8o0WuoWjqiqFzqOrbKh AeQo30VTE0YXV9+3O8kohQd3lf1omZmHB94dTmmsdwlvARbC2IEyq0fDDMRMctSMFZh+enWO9CUxW zu2hz7oQ==; X-Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from <mhal@rbox.co>) id 1xSjMN-0001t3-8N; Mon, 16 Nov 2026 00:10:07 +0100 X-Received: by submission03.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) id 1xSjML-000piU-I1; Mon, 16 Nov 2026 00:10:05 +0100 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-User-Agent: Mozilla Thunderbird 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-In-Reply-To: <DMV5NLOEYFGF.C7ITHCRCNA7P@gmail.com>