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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c1ff0342-4fe9-44ec-a212-9f547e333a5e@intel.com>
Date: Thu, 10 Apr 2025 15:05:19 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Leon Romanovsky <leon@...nel.org>, Larysa Zaremba
	<larysa.zaremba@...el.com>
CC: <intel-wired-lan@...ts.osuosl.org>, Tony Nguyen
	<anthony.l.nguyen@...el.com>, "David S. Miller" <davem@...emloft.net>, "Eric
 Dumazet" <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>, Simon Horman <horms@...nel.org>, Jonathan Corbet
	<corbet@....net>, Przemek Kitszel <przemyslaw.kitszel@...el.com>, Jiri Pirko
	<jiri@...nulli.us>, Tatyana Nikolova <tatyana.e.nikolova@...el.com>, "Andrew
 Lunn" <andrew+netdev@...n.ch>, Michael Ellerman <mpe@...erman.id.au>, "Maciej
 Fijalkowski" <maciej.fijalkowski@...el.com>, Lee Trager <lee@...ger.us>,
	Madhavan Srinivasan <maddy@...ux.ibm.com>, Sridhar Samudrala
	<sridhar.samudrala@...el.com>, Jacob Keller <jacob.e.keller@...el.com>,
	Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>, Mateusz Polchlopek
	<mateusz.polchlopek@...el.com>, Ahmed Zaki <ahmed.zaki@...el.com>,
	<netdev@...r.kernel.org>, <linux-doc@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, "Karlsson, Magnus"
	<magnus.karlsson@...el.com>, Emil Tantilov <emil.s.tantilov@...el.com>,
	"Madhu Chittim" <madhu.chittim@...el.com>, Josh Hay <joshua.a.hay@...el.com>,
	"Milena Olech" <milena.olech@...el.com>, <pavan.kumar.linga@...el.com>,
	"Singhai, Anjali" <anjali.singhai@...el.com>, Phani R Burra
	<phani.r.burra@...el.com>
Subject: Re: [PATCH iwl-next 05/14] libeth: add control queue support

From: Leon Romanovsky <leon@...nel.org>
Date: Thu, 10 Apr 2025 14:23:49 +0300

> On Thu, Apr 10, 2025 at 12:44:33PM +0200, Larysa Zaremba wrote:
>> On Thu, Apr 10, 2025 at 11:21:37AM +0300, Leon Romanovsky wrote:
>>> On Tue, Apr 08, 2025 at 02:47:51PM +0200, Larysa Zaremba wrote:
>>>> From: Phani R Burra <phani.r.burra@...el.com>
>>>>
>>>> Libeth will now support control queue setup and configuration APIs.
>>>> These are mainly used for mailbox communication between drivers and
>>>> control plane.
>>>>
>>>> Make use of the page pool support for managing controlq buffers.
>>>
>>> <...>
>>>
>>>>  libeth-y			:= rx.o
>>>>  
>>>> +obj-$(CONFIG_LIBETH_CP)		+= libeth_cp.o
>>>> +
>>>> +libeth_cp-y			:= controlq.o
>>>
>>> So why did you create separate module for it?
>>> Now you have pci -> libeth -> libeth_cp -> ixd, with the potential races between ixd and libeth, am I right?
>>>
>>
>> I am not sure what kind of races do you mean, all libeth modules themselves are 
>> stateless and will stay this way [0], all used data is owned by drivers.
> 
> Somehow such separation doesn't truly work. There are multiple syzkaller
> reports per-cycle where module A tries to access module C, which already
> doesn't exist because it was proxied through module B.
> 
>>
>> As for the module separation, I think there is no harm in keeping it modular. 
> 
> Syzkaller reports disagree with you. 

Zero proofs.

Kernel loads modules under mutex, patches relocs etc. Circular deps are
not supported. I've no idea how that possible what you describe.

> 
>> We intend to use basic libeth (libeth_rx) in drivers that for sure have no use 
>> for libeth_cp. libeth_pci and libeth_cp separation is more arbitral, as we have 
>> no plans for now to use them separately.
> 
> So let's not over-engineer it.

Let's not over-engineer Netfilter then and compile it into one module?

I don't want to load _pci/_cp when I load something different than idpf
or ixd, it makes no sense.
Moreover, libeth and libeth_xdp are still generic and can be reused by
any vendor. _pci/_cp are not and won't ever be, they are in the same
folder as generic libeth only to not create more folders. I don't want
to link everything together.

> 
>>
>> Module dependencies are as follows:
>>
>> libeth_rx and libeth_pci do not depend on other modules.
>> libeth_cp depends on both libeth_rx and libeth_pci.
>> idpf directly uses libeth_pci, libeth_rx and libeth_cp.
>> ixd directly uses libeth_cp and libeth_pci.
> 
> You can do whatever module architecture for netdev devices, but if you
> plan to expose it to RDMA devices, I will vote against any deep layered
> module architecture for the drivers.

No plans for RDMA there.

Maybe link the whole kernel to one vmlinux then?

> 
> BTW, please add some Intel prefix to the modules names, they shouldn't
> be called in generic names like libeth, e.t.c

Two modules with the same name can't exist within the kernel. libeth was
available and I haven't seen anyone wanting to take it. It's not common
at all to name a module starting with "lib".

I don't want to send huge patches which would only change the prefixes.
Nobody disagreed I can take this name back when libeth was taken.

+ above, anyone can reuse the lib, it's pretty generic, except for ixd
stuff which is isolated. What if someone takes it tomorrow, send one
more big patch which will revert the suffixes?

+ no offense, but I noted several times during reviews of mlx5 stuff
that lots of functions within the module are not prefixed anyhow and may
conflict anytime with some generic symbol.

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ