mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Jules Maselbas" <jmaselbas@zdiv.net>
To: "Sascha Hauer" <s.hauer@pengutronix.de>,
	"Barebox List" <barebox@lists.infradead.org>
Cc: "jianqiang wang" <wjq.sec@gmail.com>
Subject: Re: [PATCH v2 4/7] net: liteeth: do not read past the receive buffer
Date: Mon, 27 May 2024 14:29:31 +0200	[thread overview]
Message-ID: <D1KFEMZH7ULX.4F80HL9UHOC8@zdiv.net> (raw)
In-Reply-To: <20240527102723.3504270-5-s.hauer@pengutronix.de>

a bit unrelated, also a nitpick:

On Mon May 27, 2024 at 12:27 PM CEST, Sascha Hauer wrote:
> The driver already discards packets bigger than 2048 bytes, but that is
> already larger than the buffer we read the data into. Limit packet size
> to PKTSIZE instead which matches our receive buffer size.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/net/liteeth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/liteeth.c b/drivers/net/liteeth.c
> index 1781e26348..0d63e1da16 100644
> --- a/drivers/net/liteeth.c
> +++ b/drivers/net/liteeth.c
> @@ -223,7 +223,7 @@ static int liteeth_eth_rx(struct eth_device *edev)
>  	}
>  
>  	len = litex_read32(priv->base + LITEETH_WRITER_LENGTH);
> -	if (len == 0 || len > 2048) {
> +	if (len == 0 || len > PKTSIZE) {
>  		len = 0;
>  		dev_err(priv->dev, "%s: invalid len %d\n", __func__, len);
the len here is always zero

>  		litex_write8(priv->base + LITEETH_WRITER_EV_PENDING, reg);




  reply	other threads:[~2024-05-27 12:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 10:27 [PATCH v2 0/7] net: do not read past " Sascha Hauer
2024-05-27 10:27 ` [PATCH v2 1/7] net: cs8900: simplify buffer read loop Sascha Hauer
2024-05-27 10:27 ` [PATCH v2 2/7] net: cs8900: do not read past the receive buffer Sascha Hauer
2024-05-27 10:27 ` [PATCH v2 3/7] net: ks8851_mll: " Sascha Hauer
2024-05-27 10:27 ` [PATCH v2 4/7] net: liteeth: " Sascha Hauer
2024-05-27 12:29   ` Jules Maselbas [this message]
2024-05-27 10:27 ` [PATCH v2 5/7] net: smc911x: " Sascha Hauer
2024-05-27 12:27   ` Jules Maselbas
2024-05-27 10:27 ` [PATCH v2 6/7] net: ks8851_mll: drop return value from ks8851_rx_frame() Sascha Hauer
2024-05-27 10:27 ` [PATCH v2 7/7] net: let net rx hook return void Sascha Hauer

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=D1KFEMZH7ULX.4F80HL9UHOC8@zdiv.net \
    --to=jmaselbas@zdiv.net \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=wjq.sec@gmail.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