From: Dmitry Osipenko <digetx@gmail.com>
To: Mikko Perttunen <mperttunen@nvidia.com>
Cc: linux-tegra@vger.kernel.org, thierry.reding@gmail.com,
dri-devel@lists.freedesktop.org, jonathanh@nvidia.com
Subject: Re: [PATCH] drm/tegra: Fix comparison operator for buffer size
Date: Wed, 20 Jun 2018 18:11:44 +0300 [thread overview]
Message-ID: <5366696.aeeooRCe44@dimapc> (raw)
In-Reply-To: <20180620130358.26247-1-mperttunen@nvidia.com>
On Wednesday, 20 June 2018 16:03:58 MSK Mikko Perttunen wrote:
> Here we are checking for the buffer length, not an offset for writing
> to, so using > is correct. The current code incorrectly rejects a
> command buffer ending at the memory buffer's end.
>
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
> drivers/gpu/drm/tegra/drm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index 776c1513e582..a2bd5876c633 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -398,7 +398,7 @@ int tegra_drm_submit(struct tegra_drm_context *context,
> * unaligned offset is malformed and cause commands stream
> * corruption on the buffer address relocation.
> */
> - if (offset & 3 || offset >= obj->gem.size) {
> + if (offset & 3 || offset > obj->gem.size) {
> err = -EINVAL;
> goto fail;
> }
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-06-20 15:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 13:03 [PATCH] drm/tegra: Fix comparison operator for buffer size Mikko Perttunen
2018-06-20 15:11 ` Dmitry Osipenko [this message]
2018-06-21 13:36 ` Thierry Reding
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=5366696.aeeooRCe44@dimapc \
--to=digetx@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jonathanh@nvidia.com \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
--cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).