From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Yousef Alhouseen <alhouseenyousef@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vme_user: bound slave windows to DMA buffers
Date: Thu, 25 Jun 2026 10:47:13 +0100 [thread overview]
Message-ID: <2026062556-exalted-closable-8105@gregkh> (raw)
In-Reply-To: <20260625093137.6589-1-alhouseenyousef@gmail.com>
On Thu, Jun 25, 2026 at 11:31:37AM +0200, Yousef Alhouseen wrote:
> vme_user allocates a fixed PCI_BUF_SIZE coherent DMA buffer for each
> slave image, but VME_SET_SLAVE passes the user-supplied size to
> vme_slave_set() unchanged. An enabled window larger than PCI_BUF_SIZE lets
> the bridge expose DMA addresses beyond the allocation.
>
> The character device read/write paths also derive their bounds from
> vme_get_size(), so the oversized programmed window can make
> buffer_to_user() and buffer_from_user() access past
> image[minor].kern_buf.
>
> Reject enabled slave windows that do not fit in the backing buffer and use
> the same capped size for slave read/write/llseek bounds. Also convert the
> read/write limit checks to subtraction-based form so offset + count cannot
> wrap around the image size check.
>
> Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
> ---
> drivers/staging/vme_user/vme_user.c | 38 ++++++++++++++++++++++-------
> 1 file changed, 29 insertions(+), 9 deletions(-)
What tool did you use to find/make this change, and how was it tested?
thanks,
greg k-h
next prev parent reply other threads:[~2026-06-25 9:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 9:31 [PATCH] staging: vme_user: bound slave windows to DMA buffers Yousef Alhouseen
2026-06-25 9:47 ` Greg Kroah-Hartman [this message]
2026-06-25 11:51 ` Dan Carpenter
2026-06-25 11:58 ` Dan Carpenter
2026-06-25 13:54 ` Yousef Alhouseen
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=2026062556-exalted-closable-8105@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=alhouseenyousef@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@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 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.