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: <78d7e538-9fa0-490e-bcfb-0a5943ad80c9@lunn.ch>
Date: Thu, 7 Mar 2024 00:53:21 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
	linux-kernel@...r.kernel.org, bryan.whitehead@...rochip.com,
	richardcochran@...il.com, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net 3/3] net: lan743x: Address problems with wake option
 flags configuration sequences

On Mon, Feb 26, 2024 at 01:39:34PM +0530, Raju Lakkaraju wrote:
> Wake options handling has been reworked as follows:
> a. We only enable secure on magic packet when both secure and magic wol
>    options are requested together.

So it appears unclear what should happen here.

https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/bcm-phy-lib.c#L909

WAKE_MAGICSECURE is a standalone option. You do not need
WAKE_MAGIC. And even i you did request both WAKE_MAGIC and
WAKE_MAGICSECURE, the WAKE_MAGIC would be ignored.

https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/dp83822.c#L153

WAKE_MAGICSECURE is a standalone option. You do not need
WAKE_MAGIC. However, unlike the broadcom device, you can have both
WAKE_MAGIC and WAKE_MAGICSECURE at the same time. They are not
mutually exclusive.

This also looks to be true for other dp8**** devices.

https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/mscc/mscc_main.c#L318

WAKE_MAGICSECURE is a standalone option. You do not need
WAKE_MAGIC. Also, you can have both WAKE_MAGIC and WAKE_MAGICSECURE at
the same time. They are not mutually exclusive.

So i think your point a. above is questionable. Can the hardware
support both magic and secure magic at the same time? If so, follow
the TI way of doing it. If you cannot do both at the same time, and
that is requested, you should probably return -EOPNOTSUPP. That is
probably better than what the broadcom driver does, silently ignore
WAKE_MAGIC.

> b. If secure-on magic packet had been previously enabled, and a subsequent
>    command does not include it, we add it. This was done to workaround a
>    problem with the 'pm-suspend' application which is unaware of secure-on
>    magic packet being enabled and can unintentionally disable it prior to
>    putting the system into suspend.

The kernel should not be working around broken userspace. But i also
suspect this is to do with it being unclear if WOL options are
incremental or not. Since it seems that they are not incremental, it
does not matter if "If secure-on magic packet had been previously
enable". pm-suspend is setting Wol how it wants it, which you say is
plain magic. So magic is what the PHY driver should do. Feel free to
submit patches to pm-suspend to make it understand secure magic, or
not touch WoL at all with the assumption it has already been setup by
something else.

	  Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ