From: sashiko-bot@kernel.org
To: "Zi Yan" <ziy@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/uverbs: Don't return the shared zero page from rdma_umap_fault()
Date: Mon, 26 Oct 2026 02:20:28 +0000 [thread overview]
Message-ID: <sashiko-outbox-184597@kernel.org> (raw)
In-Reply-To: <20261025-fix-rdma_umap_fault-zero-page-v1-1-186255624f1f@nvidia.com>
> After disassociation, rdma_umap_fault() returns the shared zero page from
> ->fault for VMAs without VM_WRITE and VM_MAYWRITE. Such VMAs come from
> rdma_user_mmap_io() in drivers that clear VM_MAYWRITE and they are shared
> VM_PFNMAP. A page returned from ->fault is mapped as a normal page and goes
> through rmap code. Two issues:
>
> 1. shared zero page causes VM_WARN_ONs in rmap code,
>
> 2. normal pages in shared VM_PFNMAP VMAs cause accounting leak on arch
> without pte_special(), namely the page refcount, mapcount, and vm stats
> are never dropped.
>
> Map ufile->disassociate_page for VMAs without VM_WRITE and VM_MAYWRITE,
> with vmf_insert_pfn(). The page lives until ib_uverbs_release_file(), which
> cannot run while a VMA holds a reference to the file.
>
> Writable VMAs keep returning disassociate_page in vmf->page, thus its
> accounting leak on arch without pte_special() needs a separate fix.
>
> Userspace can see two differences after the patch. A mapping without
> VM_WRITE and VM_MAYWRITE now reads what was written through writable
> mappings of the same uverbs file instead of zeroes; after disassociation
> both are dummy data. The first fault now allocates the page and fails with
> VM_FAULT_SIGBUS if the allocation fails, as a write fault already does.
>
> Fixes: 67f269b37f9b ("RDMA/ucontext: Fix regression with disassociate")
> Signed-off-by: Zi Yan <ziy@nvidia.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261025-fix-rdma_umap_fault-zero-page-v1-1-186255624f1f@nvidia.com?part=1
next prev parent reply other threads:[~2026-10-26 2:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 2:04 [PATCH] RDMA/uverbs: Don't return the shared zero page from rdma_umap_fault() Zi Yan
2026-10-26 2:20 ` sashiko-bot [this message]
2026-10-26 8:55 ` Jose A. Perez de Azpillaga
2026-10-26 11:49 ` Jason Gunthorpe
2026-10-26 15:41 ` Zi Yan
2026-10-26 12:20 ` David Hildenbrand (Arm)
2026-10-26 15:48 ` Zi Yan
2026-10-28 8:43 ` David Hildenbrand (Arm)
2026-10-28 17:49 ` Zi Yan
2026-10-28 20:34 ` David Hildenbrand (Arm)
2026-10-29 2:00 ` Zi Yan
2026-10-29 10:44 ` David Hildenbrand (Arm)
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-184597@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=ziy@nvidia.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