From: Greg KH <gregkh@linuxfoundation.org>
To: "T.J. Mercier" <tjmercier@google.com>
Cc: stable@vger.kernel.org, Xingyu Jin <xingyuj@google.com>,
John Stultz <jstultz@google.com>,
Sumit Semwal <sumit.semwal@linaro.org>
Subject: Re: [PATCH 5.10.y] dma-buf: heaps: Fix off-by-one in CMA heap fault handler
Date: Mon, 16 Sep 2024 09:02:37 +0200 [thread overview]
Message-ID: <2024091643-proved-financial-0bb5@gregkh> (raw)
In-Reply-To: <20240916043441.323792-1-tjmercier@google.com>
On Mon, Sep 16, 2024 at 04:34:41AM +0000, T.J. Mercier wrote:
> commit ea5ff5d351b520524019f7ff7f9ce418de2dad87 upstream.
>
> Until VM_DONTEXPAND was added in commit 1c1914d6e8c6 ("dma-buf: heaps:
> Don't track CMA dma-buf pages under RssFile") it was possible to obtain
> a mapping larger than the buffer size via mremap and bypass the overflow
> check in dma_buf_mmap_internal. When using such a mapping to attempt to
> fault past the end of the buffer, the CMA heap fault handler also checks
> the fault offset against the buffer size, but gets the boundary wrong by
> 1. Fix the boundary check so that we don't read off the end of the pages
> array and insert an arbitrary page in the mapping.
>
> Reported-by: Xingyu Jin <xingyuj@google.com>
> Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementation")
This commit is in 5.11, so why:
> Cc: stable@vger.kernel.org # Applicable >= 5.10. Needs adjustments only for 5.10.
does this say 5.10?
thanks,
greg k-h
next prev parent reply other threads:[~2024-09-16 7:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 4:34 [PATCH 5.10.y] dma-buf: heaps: Fix off-by-one in CMA heap fault handler T.J. Mercier
2024-09-16 7:02 ` Greg KH [this message]
2024-09-16 7:38 ` T.J. Mercier
2024-09-16 7:44 ` Greg KH
2024-09-16 7:48 ` T.J. Mercier
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=2024091643-proved-financial-0bb5@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=jstultz@google.com \
--cc=stable@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=tjmercier@google.com \
--cc=xingyuj@google.com \
/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