From: Greg KH <gregkh@linuxfoundation.org>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kees@kernel.org
Subject: Re: [PATCH v2] usb: gadget: rndis: validate query and set message buffers
Date: Wed, 1 Apr 2026 13:40:12 +0200 [thread overview]
Message-ID: <2026040110-neatness-germicide-d4e3@gregkh> (raw)
In-Reply-To: <20260401113410.66427-1-pengpeng@iscas.ac.cn>
On Wed, Apr 01, 2026 at 07:34:10PM +0800, Pengpeng Hou wrote:
> Hi Greg,
>
> I have not tested this against an actual RNDIS host/device setup yet.
>
> For clarity, v2 did not change the code from v1; it only expanded the
> commit message.
>
> What I was trying to fix here is limited to two current-tree checks that
> are missing today:
>
> 1. rndis_msg_parser() reads MsgLength from the request body but does not
> verify that it fits within the actual EP0 request buffer length.
Yes, that's a good thing to check :)
> 2. rndis_set_response() validates the host-controlled
> InformationBufferOffset/InformationBufferLength pair before using it,
> but rndis_query_response() still passes the same fields directly into
> gen_ndis_query_resp() without corresponding bounds validation.
Ah, so that should be fixed up.
> I do not mean this patch to claim that these are the only issues in the
> RNDIS parser.
Oh, I did not think that, there are loads of issues with RNDIS that are
not covered by this patch :)
> If you want runtime testing before considering this further, I can stop
> here until I can test it properly.
Yes, please test this so that we know it doesn't break existing systems.
thanks,
greg k-h
prev parent reply other threads:[~2026-04-01 11:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 8:08 [PATCH v2] usb: gadget: rndis: validate query and set message buffers Pengpeng Hou
2026-03-30 14:23 ` Greg Kroah-Hartman
2026-04-01 11:34 ` Pengpeng Hou
2026-04-01 11:40 ` Greg KH [this message]
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=2026040110-neatness-germicide-d4e3@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pengpeng@iscas.ac.cn \
/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