From: sashiko-bot@kernel.org
To: "Aldo Ariel Panzardo" <qwe.aldo@gmail.com>
Cc: "Eugenio Perez" <eperezma@redhat.com>,
virtualization@lists.linux.dev, dri-devel@lists.freedesktop.org,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] drm/qxl: remove double page-size scaling in kmap fallback paths
Date: Wed, 23 Sep 2026 13:59:16 +0000 [thread overview]
Message-ID: <20260923135916.7C5DD1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923134952.1750600-1-qwe.aldo@gmail.com>
> qxl_bo_kmap_atomic_page() takes a page_offset parameter that callers
> compute as a byte offset aligned to a page boundary:
>
> reloc_page = qxl_bo_kmap_atomic_page(qdev, info->dst_bo,
> info->dst_offset & PAGE_MASK);
>
> The VRAM/PRIV path adds it directly to the mapping base (both in
> bytes), which is correct:
>
> offset = bo->tbo.resource->start << PAGE_SHIFT;
> return io_mapping_map_atomic_wc(map, offset + page_offset);
>
> But the two system-memory fallback paths multiply it by PAGE_SIZE
> again:
>
> rptr = bo->kptr + (page_offset * PAGE_SIZE);
>
> For page_offset = 0x5000 (page 5), this computes
> 0x5000 * 0x1000 = 0x5000000, a 80 MiB offset instead of 20 KiB,
> producing a massive out-of-bounds access into kernel memory.
>
> Remove the spurious multiplication so the fallback paths use the
> same byte-offset semantics as the io_mapping path.
>
> Fixes: f64122c1f6ad ("drm: add new QXL driver. (v1.4)")
> Cc: stable@vger.kernel.org
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260923134952.1750600-1-qwe.aldo@gmail.com?part=1
next prev parent reply other threads:[~2026-09-23 13:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 13:49 [PATCH] drm/qxl: remove double page-size scaling in kmap fallback paths Aldo Ariel Panzardo
2026-09-23 13:59 ` sashiko-bot [this message]
2026-10-07 12:17 ` Aldo Ariel
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=20260923135916.7C5DD1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=eperezma@redhat.com \
--cc=mst@redhat.com \
--cc=qwe.aldo@gmail.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