From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: hexlabsecurity@proton.me
Cc: Arnd Bergmann <arnd@arndb.de>, Alexander Graf <graf@amazon.com>,
linux-kernel@vger.kernel.org,
The AWS Nitro Enclaves Team <aws-nitro-enclaves-devel@amazon.com>
Subject: Re: [PATCH] misc: nsm: bound the device-reported response length
Date: Sun, 21 Jun 2026 07:38:02 +0200 [thread overview]
Message-ID: <2026062124-unsalted-wiry-6920@gregkh> (raw)
In-Reply-To: <20260620-b4-disp-a54b7dd6-v1-1-79d1f236a854@proton.me>
On Sat, Jun 20, 2026 at 09:42:11PM -0500, Bryam Vargas via B4 Relay wrote:
> From: Bryam Vargas <hexlabsecurity@proton.me>
>
> nsm_sendrecv_msg_locked() stores the virtqueue used-ring length reported
> by the NSM device into msg->resp.len without bounding it to the response
> buffer. A malicious or buggy backend can report a length larger than the
> response buffer; parse_resp_raw() then copies that many bytes out of the
> fixed buffer to user space, disclosing adjacent kernel heap (an
> out-of-bounds read). The request path already floors its length in
> fill_req_raw(); the response path lacks the symmetric check.
>
> Clamp the stored length to the size of the response buffer. Well-behaved
> devices report no more than the posted buffer size, so conforming traffic
> is unaffected.
Is this really the only place where a "buggy" device that is bound to
the driver can cause any problems? Shouldn't the driver only be bound
to trusted devices to start with?
thanks,
greg k-h
next prev parent reply other threads:[~2026-06-21 5:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-21 2:42 Bryam Vargas via B4 Relay
2026-06-21 5:38 ` Greg Kroah-Hartman [this message]
2026-06-21 8:07 ` Graf (AWS), Alexander
2026-06-22 7:50 ` Bryam Vargas
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=2026062124-unsalted-wiry-6920@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=aws-nitro-enclaves-devel@amazon.com \
--cc=graf@amazon.com \
--cc=hexlabsecurity@proton.me \
--cc=linux-kernel@vger.kernel.org \
/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®