All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jiale Yao" <yaojiale02@163.com>
Cc: dri-devel@lists.freedesktop.org,
	"Eugenio Perez" <eperezma@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	virtualization@lists.linux.dev
Subject: Re: [PATCH] drm/qxl: validate client monitor index before access
Date: Thu, 24 Sep 2026 12:47:57 +0000	[thread overview]
Message-ID: <20260924124757.86B511F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260924123731.803007-1-yaojiale02@163.com>

> client_monitors_config is allocated with space for count heads, while QXL
> creates qxl_num_crtc outputs whose indexes range from zero to
> qxl_num_crtc - 1.  The monitor count may be smaller than qxl_num_crtc, but
> qxl_update_offset_props() and qxl_conn_get_modes() use the output index to
> access heads[] without checking it against count.
> 
> Starting QEMU with "-device qxl-vga,xres=1024,yres=768" provides one
> client monitor while the driver creates four outputs by default.  KASAN
> reported the first out-of-bounds access during probe, with
> qxl_update_offset_props() inlined into its caller:
> 
>   BUG: KASAN: slab-out-of-bounds in
>   qxl_display_read_client_monitors_config+0x2379/0x2e30
>   Read of size 4 at addr ffff88810403e170 by task swapper/0/1
>   Call Trace:
>    qxl_display_read_client_monitors_config+0x2379/0x2e30
>    qxl_modeset_init+0x6a6/0x7b0
>    qxl_pci_probe+0x150/0x2d0
> 
> The same configuration reaches the unchecked access in
> qxl_conn_get_modes() when userspace enumerates connectors.
> 
> Skip offset updates for outputs that have no corresponding client head,
> and retain the default preferred mode dimensions in qxl_conn_get_modes()
> when its output index is outside the client head array.
> 
> Fixes: 7dea0941f880 ("drm/qxl: use suggested x/y offset properties to pass guest prefs")
> Fixes: 1b043677d4be ("drm/qxl: add qxl_add_mode helper function")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiale Yao <yaojiale02@163.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260924123731.803007-1-yaojiale02@163.com?part=1


      reply	other threads:[~2026-09-24 12:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 12:37 [PATCH] drm/qxl: validate client monitor index before access Jiale Yao
2026-09-24 12:47 ` 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=20260924124757.86B511F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=virtualization@lists.linux.dev \
    --cc=yaojiale02@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.