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: <20191224190531.GA426@localhost>
Date:   Tue, 24 Dec 2019 11:05:31 -0800
From:   Richard Cochran <richardcochran@...il.com>
To:     "Keller, Jacob E" <jacob.e.keller@...el.com>
Cc:     Vladimir Oltean <olteanv@...il.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "jakub.kicinski@...ronome.com" <jakub.kicinski@...ronome.com>,
        "f.fainelli@...il.com" <f.fainelli@...il.com>,
        "vivien.didelot@...il.com" <vivien.didelot@...il.com>,
        "andrew@...n.ch" <andrew@...n.ch>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net] net: dsa: sja1105: Fix double delivery of TX
 timestamps to socket error queue

On Tue, Dec 17, 2019 at 10:21:29PM +0000, Keller, Jacob E wrote:
> > -----Original Message-----
> > From: netdev-owner@...r.kernel.org <netdev-owner@...r.kernel.org> On
> > Behalf Of Vladimir Oltean

> My understanding was that setting it prevented the stack from
> generating a SW timestamp if the hardware timestamp was going to be
> provided. Basically, this is because we would otherwise report the
> timestamp twice to applications that expect only one timestamp.

Correct. 

> There were some patches from Miroslav that enabled optionally
> allowed the reporting of both SW and HW timestamps at the same time.

Not quite.  If the user sets SOF_TIMESTAMPING_OPT_TX_SWHW, then there
will be two packets delivered to the error queue, one SW and one HW.

> > There are many more drivers that are in principle broken with DSA PTP,
> > since they don't even have the equivalent check for priv->hwts_tx_en.

Please stop saying that.  It is not true.

> Right. I'm wondering what the correct fix would be so that we can
> fix the drivers and hopefully avoid introducing a similar issue in
> the future.

No fix is needed.  MAC drivers must set SKBTX_IN_PROGRESS and call
skb_tstamp_tx() to deliver the transmit time stamp.  DSA drivers
should call skb_complete_tx_timestamp() to deliver the transmit time
stamp, and they should *not* set SKBTX_IN_PROGRESS.

Thanks,
Richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ