lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <540c2855-da19-4562-ac17-d85225886732@linux.dev>
Date: Wed, 9 Jul 2025 16:58:26 +0800
From: Tao Chen <chen.dylane@...ux.dev>
To: Jakub Sitnicki <jakub@...udflare.com>
Cc: daniel@...earbox.net, razor@...ckwall.org, andrew+netdev@...n.ch,
 davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
 pabeni@...hat.com, ast@...nel.org, andrii@...nel.org, martin.lau@...ux.dev,
 eddyz87@...il.com, song@...nel.org, yonghong.song@...ux.dev,
 john.fastabend@...il.com, kpsingh@...nel.org, sdf@...ichev.me,
 haoluo@...gle.com, jolsa@...nel.org, mattbobrowski@...gle.com,
 rostedt@...dmis.org, mhiramat@...nel.org, mathieu.desnoyers@...icios.com,
 horms@...nel.org, willemb@...gle.com, pablo@...filter.org,
 kadlec@...filter.org, hawk@...nel.org, bpf@...r.kernel.org,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org, netfilter-devel@...r.kernel.org,
 coreteam@...filter.org
Subject: Re: [PATCH bpf-next v3 5/7] bpf: Remove attach_type in bpf_netns_link

在 2025/7/9 16:21, Jakub Sitnicki 写道:
> On Wed, Jul 09, 2025 at 11:08 AM +08, Tao Chen wrote:
>> Use attach_type in bpf_link, and remove it in bpf_netns_link.
>>
>> Acked-by: Jiri Olsa <jolsa@...nel.org>
>> Signed-off-by: Tao Chen <chen.dylane@...ux.dev>
>> ---
>>   kernel/bpf/net_namespace.c | 6 ++----
>>   1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/bpf/net_namespace.c b/kernel/bpf/net_namespace.c
>> index 63702c86275..6d27bd97c95 100644
>> --- a/kernel/bpf/net_namespace.c
>> +++ b/kernel/bpf/net_namespace.c
>> @@ -11,7 +11,6 @@
>>   
>>   struct bpf_netns_link {
>>   	struct bpf_link	link;
>> -	enum bpf_attach_type type;
>>   	enum netns_bpf_attach_type netns_type;
>>   
>>   	/* We don't hold a ref to net in order to auto-detach the link
> 
> Nit: Doesn't that create a hole? Maybe move netns_type to the end.
> 

Hi Jakub,
You are right, i will change it in v4, thanks.

pahole -C bpf_netns_link vmlinux
struct bpf_netns_link {
	struct bpf_link            link __attribute__((__aligned__(8))); /* 
0    80 */

	/* XXX last struct has 7 bytes of padding */

	/* --- cacheline 1 boundary (64 bytes) was 16 bytes ago --- */
	enum netns_bpf_attach_type netns_type;           /*    80     4 */

	/* XXX 4 bytes hole, try to pack */

	struct net *               net;                  /*    88     8 */
	struct list_head           node;                 /*    96    16 */

	/* size: 112, cachelines: 2, members: 4 */
	/* sum members: 108, holes: 1, sum holes: 4 */
	/* paddings: 1, sum paddings: 7 */
	/* forced alignments: 1 */
	/* last cacheline: 48 bytes */
} __attribute__((__aligned__(8)));

> [...]


-- 
Best Regards
Tao Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ