From: lyude@redhat.com
To: Zhenhao Wan <whi4ed0g@gmail.com>,
Danilo Krummrich <dakr@kernel.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
Dave Airlie <airlied@redhat.com>,
Ben Skeggs <bskeggs@redhat.com>
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Yuhao Jiang <danisjiang@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] drm/nouveau/nv04: check cursor buffer object size before upload
Date: Tue, 18 Aug 2026 14:24:19 -0400 [thread overview]
Message-ID: <25ccdb08f6d84982fb211444dd766d054258e41c.camel@redhat.com> (raw)
In-Reply-To: <20260813-nouveau-nv04-cursor-oob-v1-1-3f3eb37d213d@gmail.com>
On Thu, 2026-08-13 at 18:35 +0800, Zhenhao Wan wrote:
> struct drm_file *file_priv,
> return -ENOENT;
> cursor = nouveau_gem_object(gem);
>
> + if (gem->size < width * height * 4) {
> + ret = -EINVAL;
> + goto out;
> + }
> +
A good start - but width and/or height could be UINT32_MAX, so a caller
could still overflow width or height. Would you mind adding an overflow
multiply check?
> ret = nouveau_bo_map(cursor);
> if (ret)
> goto out;
>
> ---
> base-commit: db2ddb87143519e20a95aa36c60b36107b736a58
> change-id: 20260813-nouveau-nv04-cursor-oob-ad2b6001de3d
>
> Best regards,
> --
> Zhenhao Wan <whi4ed0g@gmail.com>
prev parent reply other threads:[~2026-08-18 18:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 10:35 Zhenhao Wan
2026-08-18 18:24 ` lyude [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=25ccdb08f6d84982fb211444dd766d054258e41c.camel@redhat.com \
--to=lyude@redhat.com \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=bskeggs@redhat.com \
--cc=dakr@kernel.org \
--cc=danisjiang@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
--cc=whi4ed0g@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
all inboxes | Powered by JetHome®