From: sashiko-bot@kernel.org
To: "Henry Martin" <bsdhenrymartin@gmail.com>
Cc: virtualization@lists.linux.dev,
"Michael S. Tsirkin" <mst@redhat.com>,
"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH] drm/bochs: fix VRAM out-of-bounds blit with oversized fb pitch
Date: Thu, 05 Nov 2026 06:08:58 +0000 [thread overview]
Message-ID: <sashiko-outbox-198614@kernel.org> (raw)
In-Reply-To: <20261105055000.1873029-1-bsdhenrymartin@gmail.com>
> The primary plane's atomic_update() copies the shadow framebuffer
> into the ioremapped VRAM with the fb pitch as the row stride. The
> blit offset and length grow with the pitch, but nothing checks them
> against the size of the VRAM mapping.
>
> Addfb2 only enforces a minimum pitch, so userspace can pick an
> arbitrarily large one. A single atomic commit then writes
> framebuffer content beyond the VRAM mapping, e.g. on mainline
> v7.4-rc1 (KASAN build):
>
> BUG: unable to handle page fault for address: ffffc90002800000
> Oops: Oops: 0002 [#1] SMP KASAN NOPTI
> CPU: 2 UID: 1000 PID: 1258 Comm: poc Not tainted 7.4.0-rc1 #1
> RIP: 0010:memcpy_toio+0x22/0x50
> CR2: ffffc90002800000 CR3: 0000000110f75000 CR4: 00000000003006f0
> Call Trace:
> drm_fb_memcpy+0x37c/0x6b0
> bochs_primary_plane_helper_atomic_update+0x36c/0xa20
>
> Reject framebuffers whose pitch * height exceeds the VRAM size in
> the primary plane's atomic_check(), same as the hyperv DRM driver
> does.
>
> This issue was discovered by Tencent CodeBuddy Security.
>
> Reported-by: zeroday zhao <zerodayzhao@tencent.com>
> Fixes: c3ac343c14485 ("drm/bochs: Use GEM SHMEM helpers for memory management")
> Cc: stable@vger.kernel.org
> Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261105055000.1873029-1-bsdhenrymartin@gmail.com?part=1
prev parent reply other threads:[~2026-11-05 6:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 5:50 [PATCH] drm/bochs: fix VRAM out-of-bounds blit with oversized fb pitch Henry Martin
2026-11-05 6:08 ` sashiko-bot [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=sashiko-outbox-198614@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bsdhenrymartin@gmail.com \
--cc=eperezma@redhat.com \
--cc=mst@redhat.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=virtualization@lists.linux.dev \
/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