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] [day] [month] [year] [list]
Message-ID: <20230928143958.298ee225@kmaincent-XPS-13-7390>
Date:   Thu, 28 Sep 2023 14:39:58 +0200
From:   Köry Maincent <kory.maincent@...tlin.com>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Maxim Georgiev <glipus@...il.com>,
        Horatiu Vultur <horatiu.vultur@...rochip.com>,
        Maxime Chevallier <maxime.chevallier@...tlin.com>,
        Richard Cochran <richardcochran@...il.com>,
        Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
        Gerhard Engleder <gerhard@...leder-embedded.com>,
        Hangbin Liu <liuhangbin@...il.com>,
        Russell King <linux@...linux.org.uk>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Jacob Keller <jacob.e.keller@...el.com>,
        Jay Vosburgh <j.vosburgh@...il.com>,
        Andy Gospodarek <andy@...yhouse.net>,
        Wei Fang <wei.fang@....com>,
        Shenwei Wang <shenwei.wang@....com>,
        Clark Wang <xiaoning.wang@....com>,
        NXP Linux Team <linux-imx@....com>,
        UNGLinuxDriver@...rochip.com,
        Lars Povlsen <lars.povlsen@...rochip.com>,
        Steen Hegelund <Steen.Hegelund@...rochip.com>,
        Daniel Machon <daniel.machon@...rochip.com>,
        Simon Horman <simon.horman@...igine.com>,
        Casper Andersson <casper.casan@...il.com>,
        Sergey Organov <sorganov@...il.com>,
        Michal Kubecek <mkubecek@...e.cz>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 net-next 12/12] net: remove phy_has_hwtstamp() ->
 phy_mii_ioctl() decision from converted drivers

On Thu, 28 Sep 2023 12:12:14 +0200
Köry Maincent <kory.maincent@...tlin.com> wrote:

> On Tue,  1 Aug 2023 17:28:24 +0300
> Vladimir Oltean <vladimir.oltean@....com> wrote:
> 
> > It is desirable that the new .ndo_hwtstamp_set() API gives more
> > uniformity, less overhead and future flexibility w.r.t. the PHY
> > timestamping behavior.
> > 
> > Currently there are some drivers which allow PHY timestamping through
> > the procedure mentioned in Documentation/networking/timestamping.rst.
> > They don't do anything locally if phy_has_hwtstamp() is set, except for
> > lan966x which installs PTP packet traps.
> > 
> > Centralize that behavior in a new dev_set_hwtstamp_phylib() code
> > function, which calls either phy_mii_ioctl() for the phylib PHY,
> > or .ndo_hwtstamp_set() of the netdev, based on a single policy
> > (currently simplistic: phy_has_hwtstamp()).
> > 
> > Any driver converted to .ndo_hwtstamp_set() will automatically opt into
> > the centralized phylib timestamping policy. Unconverted drivers still
> > get to choose whether they let the PHY handle timestamping or not.
> > 
> > Netdev drivers with integrated PHY drivers that don't use phylib
> > presumably don't set dev->phydev, and those will always see
> > HWTSTAMP_SOURCE_NETDEV requests even when converted. The timestamping
> > policy will remain 100% up to them.  
> 
> > +static int dev_set_hwtstamp_phylib(struct net_device *dev,
> > +				   struct kernel_hwtstamp_config *cfg,
> > +				   struct netlink_ext_ack *extack)
> > +{  
> ...
> 
> > +	if (phy_ts) {
> > +		err = phy_hwtstamp_set(dev->phydev, cfg, extack);
> > +		if (err) {
> > +			if (changed)
> > +				ops->ndo_hwtstamp_set(dev, &old_cfg, NULL);
> > +			return err;
> > +		}
> > +	}  
> 
> In this case the copy_from_user function will be call 2 times, one in
> dev_set_hwtstamp and one in the mii_ts.hwtstamp callback of the PHY driver.
> Should we create also a copied_from_user flag? Other idea?

oops sorry for the noise the issue I face seems elsewhere.
If I understand it well, two call of copy_from_user consecutive will behave the
same.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ