From: Donald Robson <Donald.Robson@imgtec.com>
To: Frank Binns <Frank.Binns@imgtec.com>,
"knaerzche@gmail.com" <knaerzche@gmail.com>,
Matt Coster <Matt.Coster@imgtec.com>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>,
"mripard@kernel.org" <mripard@kernel.org>,
"tzimmermann@suse.de" <tzimmermann@suse.de>
Cc: "daniel@ffwll.ch" <daniel@ffwll.ch>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"airlied@gmail.com" <airlied@gmail.com>,
Sarah Walker <Sarah.Walker@imgtec.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/imagination: vm: Fix heap lookup condition
Date: Mon, 11 Dec 2023 10:12:30 +0000 [thread overview]
Message-ID: <bd44e6e66db23505c0275b14805e711e3a75b4d1.camel@imgtec.com> (raw)
In-Reply-To: <20231208170856.1748413-1-knaerzche@gmail.com>
Thanks Alex!
Reviewed-by: Donald Robson <donald.robson@imgtec.com>
On Fri, 2023-12-08 at 18:08 +0100, Alex Bee wrote:
> *** CAUTION: This email originates from a source not known to Imagination Technologies. Think before you click a link or open an attachment ***
>
> When conditionally checking for heap existence of a certian address in
> pvr_vm_bind_op_map_init the condition whether the map request comes from a
> user is incorrect: The context must not be the kernel-context to be a
> user(space) context and should be looked up in pvr_heaps.
>
> That makes addresses coming from userspace not being verfied against the
> defined ranges and prevents firmware loading for meta cores.
>
> Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code")
> Signed-off-by: Alex Bee <knaerzche@gmail.com>
> ---
> drivers/gpu/drm/imagination/pvr_vm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/imagination/pvr_vm.c b/drivers/gpu/drm/imagination/pvr_vm.c
> index f42345fbe4bf..82690cee978c 100644
> --- a/drivers/gpu/drm/imagination/pvr_vm.c
> +++ b/drivers/gpu/drm/imagination/pvr_vm.c
> @@ -225,7 +225,7 @@ pvr_vm_bind_op_map_init(struct pvr_vm_bind_op *bind_op,
> u64 device_addr, u64 size)
> {
> struct drm_gem_object *obj = gem_from_pvr_gem(pvr_obj);
> - const bool is_user = vm_ctx == vm_ctx->pvr_dev->kernel_vm_ctx;
> + const bool is_user = vm_ctx != vm_ctx->pvr_dev->kernel_vm_ctx;
> const u64 pvr_obj_size = pvr_gem_object_size(pvr_obj);
> struct sg_table *sgt;
> u64 offset_plus_size;
next prev parent reply other threads:[~2023-12-11 10:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 17:08 Alex Bee
2023-12-11 10:12 ` Donald Robson [this message]
2023-12-13 15:22 ` (subset) " Maxime Ripard
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=bd44e6e66db23505c0275b14805e711e3a75b4d1.camel@imgtec.com \
--to=donald.robson@imgtec.com \
--cc=Frank.Binns@imgtec.com \
--cc=Matt.Coster@imgtec.com \
--cc=Sarah.Walker@imgtec.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=knaerzche@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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®