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: <20241005184235.22421-1-pvmohammedanees2003@gmail.com>
Date: Sun,  6 Oct 2024 00:12:33 +0530
From: Mohammed Anees <pvmohammedanees2003@...il.com>
To: andrew@...n.ch
Cc: davem@...emloft.net,
	edumazet@...gle.com,
	f.fainelli@...il.com,
	kuba@...nel.org,
	linux-kernel@...r.kernel.org,
	linux@...linux.org.uk,
	netdev@...r.kernel.org,
	olteanv@...il.com,
	pabeni@...hat.com,
	pvmohammedanees2003@...il.com
Subject: Re: [PATCH] net: dsa: Fix conditional handling of Wake-on-Lan configuration in dsa_user_set_wol

In the original code, we initialize ret = -EOPNOTSUPP and then call 
phylink_ethtool_set_wol(). If DSA supports WOL, we call set_wol(). 
However, we aren’t checking if phylink_ethtool_set_wol() succeeds, 
so I assumed both functions should be called, and if either fails,
we return -EOPNOTSUPP.


static int dsa_user_set_wol(struct net_device *dev, struct ethtool_wolinfo *w)
{
	struct dsa_port *dp = dsa_user_to_port(dev);
	struct dsa_switch *ds = dp->ds;
	int ret = -EOPNOTSUPP;

	phylink_ethtool_set_wol(dp->pl, w);

	if (ds->ops->set_wol)
		ret = ds->ops->set_wol(ds, dp->index, w);

	return ret;
}

>From your response, it seems either of the two function can handle setting 
WOL, if so shouldn't we check the return value of phylink_ethtool_set_wol() 
to ensure it succeeds?

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ