mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Daniel Machon <daniel.machon@microchip.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Steen Hegelund <Steen.Hegelund@microchip.com>,
	UNGLinuxDriver@microchip.com,
	Bjarni Jonasson <bjarni.jonasson@microchip.com>,
	Lars Povlsen <lars.povlsen@microchip.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: sparx5/lan969x: do not read past skb->len when injecting a frame
Date: Fri, 23 Oct 2026 08:34:33 +0100	[thread overview]
Message-ID: <20261023073433.GG708417@horms.kernel.org> (raw)
In-Reply-To: <20261021112533.m6fh7xoqp74uevho@DEN-DL-M70577.microsemi.net>

On Wed, Oct 21, 2026 at 01:25:33PM +0200, Daniel Machon wrote:
> > sparx5_inject() writes the frame to the injection FIFO one 32-bit word
> > at a time, and pads frames shorter than 60 bytes with zero words.
> > 
> > Before this patch, the last word is loaded whole even when skb->len is
> > not a multiple of four, so 1 to 3 bytes past the end of the frame are
> > read. For a frame shorter than 60 bytes those bytes are also
> > transmitted, as VLD_BYTES marks the whole last word valid and the
> > padding starts at the next word.
> > 
> > Write the trailing bytes from a zeroed word. The number of words written
> > and VLD_BYTES are unchanged.
> > 
> > Found by an AI code review agent, and reproduced on lan969x and sparx5
> > with register injection: bytes 57 to 59 of a 57 byte frame were not
> > zero. With the fix they are zero, and traffic still passes on both
> > chips.
> > 
> > Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support")
> > Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
> 
> I somehow forgot to include the target tree. This one goes to net.

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2026-10-23  7:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 10:48 Daniel Machon
2026-10-21 11:25 ` Daniel Machon
2026-10-23  7:34   ` Simon Horman [this message]
2026-10-23 21:00 ` patchwork-bot+netdevbpf

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=20261023073433.GG708417@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bjarni.jonasson@microchip.com \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®