Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "YuanZhe Liu" <25031212351@stu.xidian.edu.cn>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] net: usb: mcs7830: skip zero-length register dump reads
Date: Wed, 25 Nov 2026 07:21:44 +0000	[thread overview]
Message-ID: <sashiko-outbox-232773@kernel.org> (raw)
In-Reply-To: <20261125071649.7052-1-25031212351@stu.xidian.edu.cn>

> mcs7830_get_regs() passes the user-supplied regs->len straight to
> mcs7830_get_reg(), which submits a vendor control-IN request for that
> many bytes.  ETHTOOL_GREGS accepts a zero length, and ethtool_get_regs()
> still invokes the driver's get_regs() callback in that case, so a
> zero-byte dump request reaches the driver.
> 
> A zero-length USB transfer has no data stage and the USB core treats it
> as an OUT transfer, so submitting it on usb_rcvctrlpipe() triggers
> 
>   usb 1-1: BOGUS control dir, pipe 80000380 doesn't match bRequestType c0
>   WARNING: drivers/usb/core/urb.c:411 at usb_submit_urb
> 
> and taints the kernel, which becomes a denial of service when
> panic_on_warn is set.
> 
> There is nothing to read when regs->len is zero, so return early before
> issuing the transfer.
> 
> Fixes: 2a36d7083438 ("USB: driver for mcs7830 (aka DeLOCK) USB ethernet adapter")
> Cc: stable@vger.kernel.org
> Co-developed-by: Bin Yu <byu@xidian.edu.cn>
> Signed-off-by: Bin Yu <byu@xidian.edu.cn>
> Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125071649.7052-1-25031212351@stu.xidian.edu.cn?part=1

  reply	other threads:[~2026-11-25  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  7:16 [PATCH] net: usb: mcs7830: skip zero-length register dump reads YuanZhe Liu
2026-11-25  7:21 ` sashiko-bot [this message]
2026-11-25  7:23 ` netdev-bot+sinfo
2026-11-25  7:32   ` YuanZhe Liu

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=sashiko-outbox-232773@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=25031212351@stu.xidian.edu.cn \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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