mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Cc: Fan Gong <gongfan1@huawei.com>,
	netdev@vger.kernel.org, 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>,
	Xin Guo <guoxin09@huawei.com>, Gur Stavi <gur.stavi@huawei.com>,
	stable@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] hinic3: bound the Rx fragment count to MAX_SKB_FRAGS
Date: Tue, 20 Oct 2026 00:13:06 +0200	[thread overview]
Message-ID: <20261019221306.d6dfPY_y@linutronix.de> (raw)
In-Reply-To: <20261019001037.3496843-1-yhlee@isslab.korea.ac.kr>

On 2026-10-19 09:10:37 [+0900], Yehyeong Lee wrote:
> Thanks for the review.
> 
> A well-behaved device can't reach it. rx_buf_len is fixed at 2048
> regardless of MTU, so the frag count is ceil(pkt_len / 2048): a max-MTU
> frame (9600) is 5 frags, and LRO -- off by default, capped at 32K when
> enabled -- is at most 16, both below the 17 the array holds. Only the
> 16-bit length field in the completion descriptor (RQ_CQE_SGE_LEN_MASK)
> lets a device claim up to 65535 bytes, i.e. 32 frags. So it takes a
> device reporting a bogus length, i.e. broken or malicious firmware,
> which is why I treated it as a robustness fix -- I should have said so
> in the changelog.

If this is something that in general opinion never can be reached then
it might be something to target net-next and not net looking like a fix.

> I found it by code inspection, not in the field, and I don't have a
> hinic3 card, so it's untested on real hardware; I reproduced it by
> injecting an out-of-range length to get the KASAN splat in the
> changelog. The netdev bot asked for these same two things, so this
> answers it as well.

I see. That KASAN splat makes it look like something that was really
reproduced. I assumed jumbo frames and aggregation at HW level.
Just because a field is 16 bit wide, it does not mean the hardware will
utilise all its fields. 

> You're right that the bare drop is unhelpful. It only surfaces as
> rx_dropped via ndo_get_stats64, not in ethtool -S -- hinic3 has no
> get_ethtool_stats, and the stats series in net-next doesn't export
> dropped either. I'm happy to add a net_warn_ratelimited() on the
> discard path in v2; it only fires for a misbehaving device, so it won't
> spam a healthy system. Let me know if you'd like that.

I would suggest to target net-next if this can not be reached and is
just there to address a possible overflow. Maybe a warning if it was
reached after all. Fan has probably an opinion here.

> For reference, eea does the same thing -- it drops once nr_frags
> reaches MAX_SKB_FRAGS.
> 
> Thanks,
> Yehyeong

Sebastian

  reply	other threads:[~2026-10-19 22:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10  3:09 Yehyeong Lee
2026-10-10  3:16 ` netdev-bot+sinfo
2026-10-18 17:05 ` Sebastian Andrzej Siewior
2026-10-19  0:10   ` Yehyeong Lee
2026-10-19 22:13     ` Sebastian Andrzej Siewior [this message]
2026-10-20  1:12       ` Fan Gong
2026-10-20  1:52         ` Yehyeong Lee

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=20261019221306.d6dfPY_y@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gongfan1@huawei.com \
    --cc=guoxin09@huawei.com \
    --cc=gur.stavi@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=yhlee@isslab.korea.ac.kr \
    /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®