All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: hso: cap the MTU to the mux tx buffer size
@ 2026-11-16  1:49 Aibing Chen
  2026-11-16  1:53 ` netdev-bot+sinfo
  2026-11-16  1:58 ` sashiko-bot
  0 siblings, 2 replies; 4+ messages in thread
From: Aibing Chen @ 2026-11-16  1:49 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: linux-usb, netdev, linux-kernel

hso_net_start_xmit() copies skb->len bytes into odev->mux_bulk_tx_buf,
which is a fixed MUX_BULK_TX_BUF_SIZE (2048) allocation made by
hso_create_net_device().  The net device does not set max_mtu, so
userspace can raise the MTU up to IP_MAX_MTU and make that copy overflow
the buffer; the same length is passed to usb_fill_bulk_urb().

Cap the MTU at the buffer size, keeping the 14 byte allowance that the
default MTU already uses.

Fixes: 72dc1c096c70 ("HSO: add option hso driver")
Cc: stable@vger.kernel.org
Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
---
 drivers/net/usb/hso.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 71caa3764..45713c994 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2393,6 +2393,7 @@ static void hso_net_init(struct net_device *net)
 	net->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
 	net->type = ARPHRD_NONE;
 	net->mtu = DEFAULT_MTU - 14;
+	net->max_mtu = MUX_BULK_TX_BUF_SIZE - 14;
 	net->tx_queue_len = 10;
 	net->ethtool_ops = &ops;
 



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: hso: cap the MTU to the mux tx buffer size
  2026-11-16  1:49 [PATCH] net: hso: cap the MTU to the mux tx buffer size Aibing Chen
@ 2026-11-16  1:53 ` netdev-bot+sinfo
  2026-11-16  2:58   ` Aibing Chen
  2026-11-16  1:58 ` sashiko-bot
  1 sibling, 1 reply; 4+ messages in thread
From: netdev-bot+sinfo @ 2026-11-16  1:53 UTC (permalink / raw)
  To: Aibing Chen
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, linux-usb, netdev, linux-kernel

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by LLM and not proven at runtime). If it was triggered
   please include the symptoms, like the stack trace or kernel messages.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: hso: cap the MTU to the mux tx buffer size
  2026-11-16  1:49 [PATCH] net: hso: cap the MTU to the mux tx buffer size Aibing Chen
  2026-11-16  1:53 ` netdev-bot+sinfo
@ 2026-11-16  1:58 ` sashiko-bot
  1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-16  1:58 UTC (permalink / raw)
  To: Aibing Chen; +Cc: linux-usb

> hso_net_start_xmit() copies skb->len bytes into odev->mux_bulk_tx_buf,
> which is a fixed MUX_BULK_TX_BUF_SIZE (2048) allocation made by
> hso_create_net_device().  The net device does not set max_mtu, so
> userspace can raise the MTU up to IP_MAX_MTU and make that copy overflow
> the buffer; the same length is passed to usb_fill_bulk_urb().
> 
> Cap the MTU at the buffer size, keeping the 14 byte allowance that the
> default MTU already uses.
> 
> Fixes: 72dc1c096c70 ("HSO: add option hso driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116014904.556-1-chenaibing@cmss.chinamobile.com?part=1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: hso: cap the MTU to the mux tx buffer size
  2026-11-16  1:53 ` netdev-bot+sinfo
@ 2026-11-16  2:58   ` Aibing Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Aibing Chen @ 2026-11-16  2:58 UTC (permalink / raw)
  To: netdev
  Cc: Aibing Chen, netdev-bot+sinfo, andrew+netdev, davem, edumazet,
	kuba, pabeni, linux-usb, linux-kernel

On Mon, 16 Nov 2026 01:53:34 +0000, netdev-bot+sinfo wrote:
>  - How the issue was discovered, e.g. hit in production, hit during
>    development, syzbot report, manual code inspection, LLM or static
>    analysis tool scan.

Code inspection, prompted by the automated review of the companion
skb_tx_buf fix in the same driver:

https://lore.kernel.org/all/179477764293.3136.7267245337781305691@kernel.org/

That review noted that hso_net_start_xmit() copies skb->len bytes into
the fixed MUX_BULK_TX_BUF_SIZE (2048) buffer with no bound check, and
that hso_net_init() never sets max_mtu. Both statements check out in
the source, which is what this patch addresses. The syzbot memory leak
that started the series did not touch this path.

>  - Whether the issue was actually triggered, or is only theoretical
>    (e.g. found by LLM and not proven at runtime). If it was triggered
>    please include the symptoms, like the stack trace or kernel messages.

Theoretical: the overflow was not triggered at runtime and the patch
carries no runtime repro. The overflow is statically decidable from the
code (unbounded memcpy into a fixed 2048-byte allocation, plus the
missing max_mtu), so the fix stands on inspection alone. I chose the
max_mtu cap over a runtime length check because the default MTU already
fits the buffer with the same 14-byte allowance, so there is no reason
to allow a larger one.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-16  2:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16  1:49 [PATCH] net: hso: cap the MTU to the mux tx buffer size Aibing Chen
2026-11-16  1:53 ` netdev-bot+sinfo
2026-11-16  2:58   ` Aibing Chen
2026-11-16  1:58 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.