From: Greg KH <gregkh@linuxfoundation.org>
To: Sumit Garg <sumit.garg@linaro.org>
Cc: stable@vger.kernel.org, jens.wiklander@linaro.org,
patrik.lantz@axis.com, tyhicks@linux.microsoft.com
Subject: Re: [PATCH backport for 5.4/5.10/5.15] tee: optee: Fix incorrect page free bug
Date: Mon, 27 Dec 2021 13:36:22 +0100 [thread overview]
Message-ID: <YcmzRuKwe4CY0EdG@kroah.com> (raw)
In-Reply-To: <20211227121432.2694129-1-sumit.garg@linaro.org>
On Mon, Dec 27, 2021 at 05:44:32PM +0530, Sumit Garg wrote:
> commit 18549bf4b21c739a9def39f27dcac53e27286ab5 upstream.
>
> Pointer to the allocated pages (struct page *page) has already
> progressed towards the end of allocation. It is incorrect to perform
> __free_pages(page, order) using this pointer as we would free any
> arbitrary pages. Fix this by stop modifying the page pointer.
>
> Fixes: ec185dd3ab25 ("optee: Fix memory leak when failing to register shm pages")
> Cc: stable@vger.kernel.org
> Reported-by: Patrik Lantz <patrik.lantz@axis.com>
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> [SG: Backport for stable kernels]
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
> drivers/tee/optee/shm_pool.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2021-12-27 12:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-27 12:14 [PATCH backport for 5.4/5.10/5.15] tee: optee: Fix incorrect page free bug Sumit Garg
2021-12-27 12:36 ` 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=YcmzRuKwe4CY0EdG@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jens.wiklander@linaro.org \
--cc=patrik.lantz@axis.com \
--cc=stable@vger.kernel.org \
--cc=sumit.garg@linaro.org \
--cc=tyhicks@linux.microsoft.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