Netdev List
 help / color / mirror / Atom feed
From: Luke Howard <lukeh@padl.com>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, netdev@vger.kernel.org,
	Vladimir Oltean <olteanv@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	Richard Cochran <richardcochran@gmail.com>,
	Cedric Jehasse <cedric.jehasse@gmail.com>,
	Kieran Tyrrell <kieran@sienda.com>,
	Max Holtmann <mh@rme-audio.de>, Max Hunter <max@huntershome.org>,
	Christoph Mellauner <christoph.mellauner@joyned.at>,
	Simon Gapp <simon.gapp@gapp-audio.com>
Subject: Re: [PATCH net-next v4 5/5] net: dsa: mv88e6xxx: embedded PTP timestamp support
Date: Tue, 28 Jul 2026 15:55:33 +1000	[thread overview]
Message-ID: <8657BCE5-A6C4-4A27-84D7-F735D35AFF45@padl.com> (raw)
In-Reply-To: <20260728035957.DC9821F000E9@smtp.kernel.org>


> [Severity: Low]
> Is it possible for chip->tag_protocol to be modified concurrently by
> mv88e6xxx_change_tag_protocol() in process context?
> 
> If this runs in the fast path rx softirq without READ_ONCE() and
> WRITE_ONCE() annotations, could this cause a data race?

Should not be an issue in practice because the tag protocol cannot be changed whilst the port is up.

> [Severity: High]
> If ptp_ops->global_enable() or ptp_ops->port_enable() fails and returns an
> error here, does this code leak the increment to chip->enable_count?
> 
> If the count remains incremented on failure, could this leave the hardware
> state permanently out of sync and break the ability to enable or disable PTP?

Fixed in next revision.

> [Severity: High]
> This is a pre-existing issue, but can this dereference of hdr->sequence_id
> result in an out-of-bounds read?
> 
> If an skb containing a PTP packet is received fragmented such that the PTP
> header sits in the paged data area, ptp_parse_header() returns a pointer
> extending past the linear region.

Same issue as you pointed out in 1/5 and 2/5. It is pre-existing and affects any caller of ptp_parse_header(). Perhaps ptp_parse_header() needs to linearize the SKB itself.

Luke

      parent reply	other threads:[~2026-07-28  5:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27  3:59 [PATCH net-next v4 0/5] net: dsa: mv88e6xxx: various hwstamp fixes Luke Howard
2026-07-27  3:59 ` [PATCH net-next v4 1/5] net: dsa: mv88e6xxx: only time stamp PTPv2 frames Luke Howard
     [not found]   ` <20260728035958.951161F00A3A@smtp.kernel.org>
2026-07-28  5:50     ` Luke Howard
2026-07-27  3:59 ` [PATCH net-next v4 2/5] net: dsa: mv88e6xxx: use ARRIVAL1 counter for all peer delay messages Luke Howard
2026-07-27  3:59 ` [PATCH net-next v4 3/5] net: dsa: mv88e6xxx: decouple the PTP timecounter from the register lock Luke Howard
     [not found]   ` <20260728040001.D87D21F00A3E@smtp.kernel.org>
2026-07-28  5:52     ` Luke Howard
2026-07-27  3:59 ` [PATCH net-next v4 4/5] dt-bindings: net: dsa: add EDSA arrival-timestamp tag protocol Luke Howard
2026-08-10  7:03   ` Krzysztof Kozlowski
2026-07-27  3:59 ` [PATCH net-next v4 5/5] net: dsa: mv88e6xxx: embedded PTP timestamp support Luke Howard
     [not found]   ` <20260728035957.DC9821F000E9@smtp.kernel.org>
2026-07-28  5:55     ` Luke Howard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8657BCE5-A6C4-4A27-84D7-F735D35AFF45@padl.com \
    --to=lukeh@padl.com \
    --cc=andrew@lunn.ch \
    --cc=cedric.jehasse@gmail.com \
    --cc=christoph.mellauner@joyned.at \
    --cc=kieran@sienda.com \
    --cc=kuba@kernel.org \
    --cc=max@huntershome.org \
    --cc=mh@rme-audio.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=richardcochran@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=simon.gapp@gapp-audio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox