From: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/vkms: off by one in vkms_gem_fault()
Date: Mon, 16 Jul 2018 11:26:34 +0000 [thread overview]
Message-ID: <20180716112634.jpxifuvjfzmralsq@smtp.gmail.com> (raw)
In-Reply-To: <20180714104951.akt34gkcq54d5pvl@kili.mountain>
Hi Dan,
Thanks for your patch. I checked and tested it, everything is fine.
On 07/14, Dan Carpenter wrote:
> The > should be >= so that we don't read one page beyond the end of the
> obj->pages[] array.
>
> Fixes: 559e50fd34d1 ("drm/vkms: Add dumb operations")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c
> index c7e38368602b..2cca8c2f260f 100644
> --- a/drivers/gpu/drm/vkms/vkms_gem.c
> +++ b/drivers/gpu/drm/vkms/vkms_gem.c
> @@ -55,7 +55,7 @@ int vkms_gem_fault(struct vm_fault *vmf)
> page_offset = (vaddr - vma->vm_start) >> PAGE_SHIFT;
> num_pages = DIV_ROUND_UP(obj->gem.size, PAGE_SIZE);
>
> - if (page_offset > num_pages)
> + if (page_offset >= num_pages)
> return VM_FAULT_SIGBUS;
>
> ret = -ENOENT;
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
prev parent reply other threads:[~2018-07-16 11:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-14 11:04 [PATCH] drm/vkms: off by one in vkms_gem_fault() Dan Carpenter
2018-07-16 11:26 ` Rodrigo Siqueira [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=20180716112634.jpxifuvjfzmralsq@smtp.gmail.com \
--to=rodrigosiqueiramelo@gmail.com \
--cc=airlied@linux.ie \
--cc=dan.carpenter@oracle.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@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