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: <Zv_0ESPJgHKhFIwk@pengutronix.de>
Date: Fri, 4 Oct 2024 15:56:33 +0200
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Andrew Lunn <andrew@...n.ch>
Cc: Kory Maincent <kory.maincent@...tlin.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Jonathan Corbet <corbet@....net>,
	Donald Hunter <donald.hunter@...il.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	linux-doc@...r.kernel.org, Kyle Swenson <kyle.swenson@....tech>,
	Dent Project <dentproject@...uxfoundation.org>,
	kernel@...gutronix.de
Subject: Re: [PATCH net-next 11/12] net: pse-pd: Add support for event
 reporting using devm_regulator_irq_helper

On Thu, Oct 03, 2024 at 05:22:58PM +0200, Andrew Lunn wrote:
> > Indeed, but regulator API already provide such events, which will even be sent
> > when we enable or disable the PSE. Should we write a second event management.
> > Using regulator event API allows to report over current internal events to the
> > parents regulator the power supply of the PSE which could also do something to
> > avoid smoke.
> > 
> > Or maybe we should add another wrapper which will send PSE ethtool netlink
> > notification alongside the regulator notifications supported by this patch.
> > 
> > > Also, how do regulator events work in combination with network
> > > namespaces? If you move the interface into a different network
> > > namespace, do the regulator events get delivered to the root namespace
> > > or the namespace the interface is in?
> > 
> > regulator events are sent in root namespace.
> 
> I think we will need two event, the base regulator event, and a
> networking event. Since it is a regulator, sending a normal regulator
> event makes a lot of sense. But mapping that regulator event to a
> netns:ifnam is going to be hard. Anything wanting to take an action is
> probably going to want to use ethtool, and so needs to be in the
> correct netns, etc. But it does get messy if there is some sort of
> software driven prioritisation going on, some daemon needs to pick a
> victim to reduce power to, and the interfaces are spread over multiple
> network namespaces.
> 
> What i don't know is if we can use an existing event, or we should add
> a new one. Often rtnetlink_event() is used:
> 
> https://elixir.bootlin.com/linux/v6.12-rc1/source/net/core/rtnetlink.c#L6679
> 
> but without some PSE information in it, it would be hard to know why
> it was sent. So we probably either want a generic ethtool event, or a
> PSE event.

Hm... assuming we have following scenario:

                                  .---------   PI 1
                                 / .---------  PI 2
                   .========= PSE /----------( PI 3 ) NNS red
                  //              \----------( PI 4 ) NNS blue
Main supply      //                `---------( PI 5 ) NNS blue
o================ยด--- System, CPU

In this case we seems to have a new challenge:

On one side, a system wide power manager should see and mange all ports.
On other side, withing a name space, we should be able to play in a
isolated sand box. There is a reason why it is isolated. So, we should
be able to sandbox power delivery and port prios too. Means, by creating
network names space, we will need a power names space. 

I can even imagine a use case: an admin limited access to a switch for
developer. A developer name space is created with PSE budget and max
prios available for this name space. This will prevent users from DoSing
system critical ports.

At this point, creating a power name space will an overkill for this
patch set, so it should be enough to allow controlling prios over
ethtool per port and isolation support if needed.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ