🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25044

Re: [PATCH net v12 0/2] tun: fix re-attaching the socket filter

#25044
From: weirongguang
Date: Tue, 01 Dec 2026 07:30
40 lines
10053 bytes

willemb@google.com wrote:
> Rongguang Wei wrote:
>> From: Rongguang Wei <weirongguang@kylinos.cn>
> 
>> This series fixes attaching a queue to a TAP device, which re-installs the
>> socket filter of a persistent device.
> 
>> TUNATTACHFILTER keeps only the sock_fprog header, so the instructions are
>> read from user space again for every queue that is attached later. Keep
>> the program on the device instead, run it from tun_net_xmit(), and record
>> IFF_NOFILTER per queue. Patch 1 does that. Also removes the exports of
>> sk_attach_filter() and sk_detach_filter() because no caller in a module.
> 
>> Patch 2 adds selftests for the re-attach, for bad programs with and without
>> queues, and for the IFF_NOFILTER paths.
> 
>> Thanks to Willem de Bruijn and Alexei Starovoitov for the reviews.
> 
>> ---
>> v12:
>>    - drop the EXPORT_SYMBOL_GPL() of sk_attach_filter() and
>>      sk_detach_filter(), as Alexei asked.  It is a cleanup on its own, so it
>>      goes in a separate patch and the stable backport of the fix does not
>>      carry it
> 
>     The v12 changelog is stale (as Alexei noted on-list) and contradicts
>     the actual series: the EXPORT_SYMBOL_GPL() removals in net/core/filter.c were
>     folded directly into Patch 1/2, which carries Fixes: 54f968d6efdb. Dropping
>     exported core networking symbols is a net-next cleanup and should not be
>     carried by a Fixes-tagged net patch destined for stable backports; please
>     drop the net/core/filter.c hunk from this net series and send it separately
>     to net-next once the fix lands.
Sorry for the stale changelog: that text described the plan, not what the series ended up containing.

v13 will drop the net/core/filter.c hunk, so the series is tun.c plus the
selftests only. The export removal will follow as a separate net-next
patch once the fix is in, which is also what Alexei asked for originally.
Technical Details
Message-ID: <59bbb352-6179-47b5-b99a-aa156ff6f883@kylinos.cn>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374798-linux-kernel-netdev=dewy.ru
References: <20261123054209.89946-1-clementwei90@163.com> <willemb.2f9ab07256d02@google.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374798-linux-kernel-netdev=dewy.ru
From: weirongguang@kylinos.cn (weirongguang)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v12 0/2] tun: fix re-attaching the socket filter
Date: Tue, 1 Dec 2026 15:30:47 +0800
Organization: Usenet Network
Message-ID: <59bbb352-6179-47b5-b99a-aa156ff6f883@kylinos.cn>
References: <20261123054209.89946-1-clementwei90@163.com>
 <willemb.2f9ab07256d02@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1648539"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:80aWt5v83G8a47+cF0nvp9AXD/k= sha256:foUmbqrUYHqXNh8T8ma9dDlVwcNxTrt1JmqV4xxX6Gg=
	sha1:phOxcUHD5SOIxoFfmkemESsXvfU= sha256:9uyfAJhF3Icy4OwUW6N6nQEaNWGgETa7U19UEGisY+Y=
Content-Language: en-US
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 003E911729F; Tue,  1 Dec 2026 10:31:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[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-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 pAQfSxrH9OVb;
	Tue,  1 Dec 2026 10:31:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374798-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=kylinos.cn
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id D7B0F117294; Tue,  1 Dec 2026 10:31:14 +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 9A2FB276BC; Tue,  1 Dec 2026 07:31:08 +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=1796110263;
	b=QhtDScRs3CJ69tQYIWkUYrnA3T/+OLrSZYP7R9xXYzwKfSnIW3LVPadm/u58d/RMvb7y
	 ssVnkI8gsSs9OlE8CbCyHhadd9RyCgdNjrPt5a8IwZjV+0hR1BZnoGMiGDXvlJNu1Er+L
	 tiWsBCrp3mUpgLmOFmsn+K+OZZ+0RPgEyqt1i13tAN95lc78gKSVL4SPlh3rt0MQPF9xQ
	 o/K46KnAC1Cgkxf6n63pGzPbht6m+4UExrWHW7BM1LH9wjzRGKYAcbSYxc/xOewvQvEQQ
	 NsK+GtwUKhG8SIF2zK3mBUZ0Jp16eFi0OpX297SwlllZIS1w8YmO1uDYkUIIsp2tAOA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796110263;
	h=X-Original-To:Received:DMARC-Filter:X-UUID:X-CID-P-RULE:X-CID-O-INFO:
	 X-CID-META:X-CID-BVR:X-CID-BAS:X-CID-FACTOR:X-CID-RHF:X-UUID:X-User:
	 Received:Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=Fc96u5Gpgqn1E6PD7AI+bdXAFEeFrkRF6pYfaIQzTtg=;
	b=NN+vuV7EyLbpZqzg6UaY5djs+01wrqfHyogW80BHXmIU3w7+rnEhgsF5tvGCOxgwNkYJ
	 EviU1OGxPGyWvUAbhst5N212IGVlUNanfiXxaVBl4+vfgv9koMjaaNE89CZFlesaKH0TM
	 +d01z3RZnrxEBuuZ6XvryWMhjEfg08c0MNhLkMnipRJkIQ83Ek2pckF+rb9Dy8VRFJpz7
	 j6w32n+dTLJ/CuGGX5cqOSDBkBSdCord38U+cbiJ+h1qJRRpC3fcdTS6twtwySTWWtCHw
	 b6jJN4l9+V4Fh475rM1cB293A2Rfd0mpa5Vyf2bMcFaGBy2lAlMAEHhguBV0svvknQQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=kylinos.cn;
	spf=pass smtp.mailfrom=kylinos.cn;
	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 C18D7606A690;
	Tue,  1 Dec 2026 07:31:03 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=124.126.103.232
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796110263;
	b=3wh1WfYSJPKXFH7Vdr9y2EWcx9ZG0o4CSaLf6kFrVkmn7bC3FEEFG/diDg4HeTKeOeCf
	 n55eYt4MF6tz0OJ55KHv+fU3w91r72CFo6/UPUEuZk4Iq0vyqHX7wrpq+qRgiL4VtK/+Q
	 ucKfvOq4oypAPxwMnkJXWJYzBuD+gs+rQc4hltvfia5Jwe7aVtmi/LFl6bKz6O5LtOQZw
	 Sd1fbzeTcZTbjGQWjNm0KoVubcTr+6qePOtsW3s4SL6+EbLnhYU3ATboOn3kE9o7F/Kgc
	 vUagonvGuarzljTU1cC/IDw6Nl88IFpW4b5EN+vo+lz+bspx+hT+mhKWtMw3plpOtHw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796110263;
	h=DMARC-Filter:X-UUID:X-CID-P-RULE:X-CID-O-INFO:X-CID-META:X-CID-BVR:
	 X-CID-BAS:X-CID-FACTOR:X-CID-RHF:X-UUID:X-User:Received:Message-ID:
	 Date:MIME-Version:User-Agent:Subject:To:Cc:References:
	 Content-Language:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=Fc96u5Gpgqn1E6PD7AI+bdXAFEeFrkRF6pYfaIQzTtg=;
	b=0JHt4dsR/o7B4brmwPpHoFHfjG9Csu6cVvT7dOeTfxNyvDQcLvnOaQaCohGY+1ZWP3gb
	 H+5jY2VEP3HIu/tenG7EWTlaQl0lXhXjK5VwZ2SJGxDeRzdfxLtvLTTSifD0U3RWcBpeW
	 /gcjhfWPQFDtyd3KBw5ILB0pYpcnXwjuGHUsRS3zy+S3AyvUtb+2/ngDtOQoOA7W8UgKy
	 ACLLYMQOMGF462Xex/exM+gwIr2S5zcGmEIDLTZjt6CEX6xTC3/yPy7MOIvtz+eHAoVAt
	 aaB6ZzkyYbSHhS48UZWxji50GFMhme9Ph+8uV7rmpcCQ41l8aas4ssjghta71JDV1DA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=kylinos.cn;
	spf=pass smtp.mailfrom=kylinos.cn;
	arc=none smtp.remote-ip=124.126.103.232
X-Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3907606A33F;
	Tue,  1 Dec 2026 07:31:00 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E3907606A33F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn
X-UUID: 222bb068ed5911f19a56ed5b684f684d-20261201
X-CID-P-RULE: Release_Ham
X-CID-O-INFO: VERSION:1.3.19,REQID:fcf645ab-277b-45da-b843-0ffca0ce5560,IP:0,U
	RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:
	release,TS:0
X-CID-META: VersionHash:7db8b62,CLOUDID:76253a9d82013607f747d0e499ca28e2,BulkI
	D:nil,BulkQuantity:0,SF:80|81|82|83|102|865|898,TC:nil,Content:0|15|50|99,
	EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OS
	A:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0
X-CID-BVR: 2,SSN|SDN
X-CID-BAS: 2,SSN|SDN,0,_
X-CID-FACTOR: TF_CID_SPAM_SNR
X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E
X-UUID: 222bb068ed5911f19a56ed5b684f684d-20261201
X-User: weirongguang@kylinos.cn
X-Received: from [10.42.124.137] [(10.44.16.150)] by mailgw.kylinos.cn
	(envelope-from <weirongguang@kylinos.cn>)
	(Generic MTA with TLSv1.3 TLS_AES_128_GCM_SHA256 128/128)
	with ESMTP id 1002863031; Tue, 01 Dec 2026 15:30:50 +0800
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: willemdebruijn.kernel@gmail.com, jasowangio@gmail.com,
 andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org, ast@kernel.org,
 alexei.starovoitov@gmail.com, andrii@kernel.org
X-In-Reply-To: <willemb.2f9ab07256d02@google.com>