From: sashiko-bot@kernel.org
To: "Matthew Auld" <matthew.auld@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v5 8/8] drm/xe: convert PCI barrier mmap to use xe_mmio_gem
Date: Tue, 08 Sep 2026 17:23:37 +0000 [thread overview]
Message-ID: <20260908172337.E78F41F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260908165046.1393557-18-matthew.auld@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The conversion to generic `xe_mmio_gem_mmap` drops the read access restrictions for the PCI barrier, allowing unprivileged userspace to map the write-only PCIe doorbell with `PROT_READ`.
--
commit ef90a93714d00fe81619728388f0697e023978dd
Author: Matthew Auld <matthew.auld@intel.com>
drm/xe: convert PCI barrier mmap to use xe_mmio_gem
This commit converts the PCI barrier mmap to use xe_mmio_gem, which
replaces the hard-coded fake offset design and removes duplicate code.
Userspace still queries the fake offset as before, but it is now managed
by the generic component.
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
[ ... ]
> @@ -3664,6 +3665,39 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
> return err;
> }
>
> +static int xe_gem_pci_barrier_mmap_offset(struct xe_device *xe, struct drm_file *file,
> + struct drm_xe_gem_mmap_offset *args)
> +{
[ ... ]
> + if (!*barrier) {
> + phys_addr_t phys_addr;
> +
> +#define LAST_DB_PAGE_OFFSET 0x7ff000
> + phys_addr = pci_resource_start(to_pci_dev(xe->drm.dev), 0) +
> + LAST_DB_PAGE_OFFSET;
> + *barrier = xe_mmio_gem_create(xe, file, phys_addr, SZ_4K);
[Severity: High]
Does the conversion to the generic xe_mmio_gem framework drop the read
access restrictions for the PCI barrier?
The original xe_pci_barrier_mmap handler explicitly checked and rejected
read access before it was removed in this patch:
xe_pci_barrier_mmap() {
...
if (vma->vm_flags & (VM_READ | VM_EXEC))
return -EINVAL;
vm_flags_clear(vma, VM_MAYREAD | VM_MAYEXEC);
...
}
Without this protection, unprivileged userspace might be able to map the
write-only PCIe doorbell with PROT_READ. If userspace issues a memory read
to this write-only hardware register, the PCIe endpoint typically returns
an Unsupported Request (UR) completion.
Could this trigger Advanced Error Reporting (AER) faults, Machine Check
Exceptions (MCE), or system hangs, leading to a local denial of service?
> + if (IS_ERR(*barrier)) {
> + int err = PTR_ERR(*barrier);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260908165046.1393557-10-matthew.auld@intel.com?part=8
next prev parent reply other threads:[~2026-09-08 17:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 16:50 [PATCH v5 0/8] drm/xe/mmio_gem: fix fault handler and destroy path Matthew Auld
2026-09-08 16:50 ` [PATCH v5 1/8] drm/xe/mmio_gem: forbid VMA split Matthew Auld
2026-09-08 16:50 ` [PATCH v5 2/8] drm/xe/mmio_gem: use write-back mapping for dummy page Matthew Auld
2026-09-08 16:50 ` [PATCH v5 3/8] drm/xe/mmio_gem: simplify fault handler loop Matthew Auld
2026-09-08 16:50 ` [PATCH v5 4/8] drm/xe/mmio_gem: Revoke drm_vma_node on xe_mmio_gem destroy Matthew Auld
2026-09-08 16:50 ` [PATCH v5 5/8] drm/xe/mmio_gem: cache the dummy page per object Matthew Auld
2026-09-08 16:50 ` [PATCH v5 6/8] drm/xe/mmio_gem: fix destroy flow Matthew Auld
2026-09-08 17:12 ` sashiko-bot
2026-09-08 17:23 ` Matthew Auld
2026-09-08 16:50 ` [PATCH v5 7/8] drm/xe/mmio_gem: reject VM_EXEC and drop VM_DONTCOPY Matthew Auld
2026-09-08 16:50 ` [PATCH v5 8/8] drm/xe: convert PCI barrier mmap to use xe_mmio_gem Matthew Auld
2026-09-08 17:07 ` Thomas Hellström
2026-09-08 17:23 ` sashiko-bot [this message]
2026-09-08 16:59 ` ✓ CI.KUnit: success for drm/xe/mmio_gem: fix fault handler and destroy path (rev5) Patchwork
2026-09-08 17:36 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-08 22:52 ` ✓ Xe.CI.FULL: " Patchwork
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=20260908172337.E78F41F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=sashiko-reviews@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