mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: 潘煜杭 <panyuhang@hdu.edu.cn>
Cc: zack.rusin@broadcom.com, bcm-kernel-feedback-list@broadcom.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	security@kernel.org
Subject: Re: reject PRIME export without TTM backing
Date: Thu, 29 Oct 2026 09:59:53 +0100	[thread overview]
Message-ID: <2026102940-unlivable-cytoplast-352a@gregkh> (raw)
In-Reply-To: <ACEAWQCGLEhWF5vMItAIpqoW.1.1793262795047.Hmail.242270054@hdu.edu.cn>

On Thu, Oct 29, 2026 at 04:33:15PM +0800, 潘煜杭 wrote:
> Hello,
> 
> GPT-5 assisted with the initial analysis and drafting the proposed fix. I am
> responsible for this report and patch.
> 
> While fuzzing the vmwgfx PRIME import path, I observed a kernel NULL pointer
> dereference in vmw_gem_object_get_sg_table(). The userspace operation was
> DRM_IOCTL_PRIME_FD_TO_HANDLE. The call path was:
> 
>   __x64_sys_ioctl()
>     -> vmw_unlocked_ioctl()
>     -> vmw_generic_ioctl()
>     -> drm_ioctl()
>     -> drm_prime_fd_to_handle_ioctl()
>     -> vmw_prime_fd_to_handle()
>     -> drm_gem_prime_fd_to_handle()
>     -> drm_gem_prime_import_dev()
>     -> dma_buf_map_attachment()
>     -> drm_gem_map_dma_buf()
>     -> vmw_gem_object_get_sg_table()
> 
> The vmwgfx callback obtains the TTM buffer object and uses bo->ttm as the
> embedded dma_ttm member of struct vmw_ttm_tt. In the crashing path, bo->ttm
> was NULL. container_of() consequently produced a NULL-based vmw_ttm_tt
> pointer, and reading vmw_tt->vsgt.sgt faulted at offset 0x88:
> 
>   BUG: kernel NULL pointer dereference, address: 0000000000000088
>   RIP: 0010:vmw_gem_object_get_sg_table+0x2f/0xa0
>   RBP: 0000000000000000
>   CR2: 0000000000000088
> 
> The faulting instruction reads from [RBP + 0x88]; with RBP equal to zero,
> this matches the reported address. The callback requires a vmwgfx TTM
> translation table, so it must reject an object without bo->ttm before
> container_of() and member access. This patch returns -EINVAL in that case.
> 
> The patch below is against the Linux 7.3 source tree; it
> applies cleanly and passes checkpatch.pl --strict.
> 
> Assisted-by: OpenAI Codex (GPT-5)
> Signed-off-by: Yuhang Pan <242270054@hdu.edu.cn>

No Fixes: or cc: stable tags?

thanks,

greg k-h

      reply	other threads:[~2026-10-29  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  8:33 潘煜杭
2026-10-29  8:59 ` Greg KH [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=2026102940-unlivable-cytoplast-352a@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=airlied@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=panyuhang@hdu.edu.cn \
    --cc=security@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=zack.rusin@broadcom.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®