Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Wen Jiang <jiangwenxiaomi@gmail.com>
Cc: Barry Song <baohua@kernel.org>,
	"David Hildenbrand (Arm)" <david@kernel.org>,
	catalin.marinas@arm.com, will@kernel.org, urezki@gmail.com,
	linux-mm@kvack.org, dev.jain@arm.com, ryan.roberts@arm.com,
	anshuman.khandual@arm.com, rppt@kernel.org, leo.yan@arm.com,
	xueyuan.chen21@gmail.com, chleroy@kernel.org,
	maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
	ajd@linux.ibm.com, jiangwen6@xiaomi.com,
	linux-arm-kernel@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12 09/10] mm/vmalloc: map contiguous pages in batches for vmap() if possible
Date: Wed, 2 Dec 2026 13:38:15 -0800	[thread overview]
Message-ID: <20261202133815.8e89255e321f272c2b2c4146@linux-foundation.org> (raw)
In-Reply-To: <CAHKocdEXb+UfSi7r+HAy+PJa+8ApmFjkK4f8f9Dh9fhYssiE4Q@mail.gmail.com>

On Wed, 2 Dec 2026 18:23:00 +0800 Wen Jiang <jiangwenxiaomi@gmail.com> wrote:

> On Wed, 2 Dec 2026 at 17:45, Barry Song <baohua@kernel.org> wrote:
> >
> > On Wed, Dec 2, 2026 at 5:36 PM David Hildenbrand (Arm) <david@kernel.org> wrote:
> > [...]
> >
> > > >
> > > > Hi David,
> > > >
> > > > Thanks, the analysis is right. This patch sets VM_UNINITIALIZED on the
> > > > area until the mapping is complete, so show_busy_info() skips it the
> > > > same way vread_iter() does, and clear_vm_uninitialized_flag() orders
> > > > the stores to area->pages and area->nr_pages before the flag is
> > > > cleared. So this race is covered as well.
> > >
> > > Is this patch already upstream or could we still add Fixes and decide on stable?
> >
> > It's still in mm-new/mm-unstable, so I think it's perfectly fine to
> > add a Fixes tag?

On Wed, 2 Dec 2026 10:13:34 +0100 "David Hildenbrand (Arm)" <david@kernel.org> wrote:

> Apparently this thing here fixes an issue:
> 
> When CONFIG_PROC_FS and CONFIG_NUMA are enabled, a race between vmap()
> called with VM_MAP_PUT_PAGES and a concurrent /proc/vmallocinfo read can
> cause a NULL pointer dereference in show_numa_info():

/proc/vmallocinfo is mode 0400.

And I am told that the vmap(VM_MAP_PUT_PAGES) callsites are also
privileged:

- i915 GVT setup: Host administrator creates a virtual GPU; this
  calls shmem_pin_map().

- i915 selftests: Must be built and enabled through driver/module
  setup; normally administrator controlled.  These also call
  shmem_pin_map().

- I/O-iterator KUnit test: Runs at boot or module load when
  configured; administrator controlled.

> Yes, the tag would be
> 
> Fixes: b944afc9d64d ("mm: add a VM_MAP_PUT_PAGES flag for vmap")
> 
> David, do you think it should also have Cc: stable?

The patch needs some dental work to make it apply to mainline and given
the above I'd say we skip cc:stable?


  reply	other threads:[~2026-12-02 21:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 13:49 [PATCH v12 00/10] mm/vmalloc: Speed up ioremap, vmalloc and vmap with contiguous memory Wen Jiang
2026-11-07 13:49 ` [PATCH v12 01/10] arm64/mm: add vmap_pte_set_huge() and vmap_pte_clear_huge() Wen Jiang
2026-11-07 13:49 ` [PATCH v12 02/10] powerpc/8xx: add vmap_pte_set_huge() Wen Jiang
2026-11-07 13:49 ` [PATCH v12 03/10] mm/vmalloc: use vmap_pte_set_huge()/vmap_pte_clear_huge() for PTE-level block mappings Wen Jiang
2026-11-07 13:49 ` [PATCH v12 04/10] arm64/hugetlb: drop the init_mm special case in clear_flush() Wen Jiang
2026-11-07 13:49 ` [PATCH v12 05/10] arm64/vmalloc: allow arch_vmap_pte_range_map_size() to batch multiple CONT_PTE Wen Jiang
2026-11-07 13:49 ` [PATCH v12 06/10] mm/vmalloc: extract vmap_set_ptes() to consolidate PTE mapping logic Wen Jiang
2026-11-07 13:49 ` [PATCH v12 07/10] mm/vmalloc: extend page table walk to support larger page_shift sizes and eliminate page table rewalk Wen Jiang
2026-11-11  3:09   ` Wen Jiang
2026-11-07 13:49 ` [PATCH v12 08/10] mm/vmalloc: extract vm_shift() to consolidate mapping shift selection Wen Jiang
2026-11-07 13:49 ` [PATCH v12 09/10] mm/vmalloc: map contiguous pages in batches for vmap() if possible Wen Jiang
2026-12-02  9:13   ` David Hildenbrand (Arm)
2026-12-02  9:32     ` Wen Jiang
2026-12-02  9:36       ` David Hildenbrand (Arm)
2026-12-02  9:45         ` Barry Song
2026-12-02 10:23           ` Wen Jiang
2026-12-02 21:38             ` Andrew Morton [this message]
2026-11-07 13:49 ` [PATCH v12 10/10] mm/vmalloc: align vm_area so vmap() can batch mappings Wen Jiang
2026-11-09  7:08 ` [PATCH v12 00/10] mm/vmalloc: Speed up ioremap, vmalloc and vmap with contiguous memory Andrew Morton
2026-11-09 11:07   ` Wen Jiang
2026-11-09 11:38     ` Uladzislau Rezki
2026-11-09 14:02     ` Leo Yan
2026-11-09 17:24       ` Andrew Morton
2026-11-11  3:08         ` Wen Jiang

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=20261202133815.8e89255e321f272c2b2c4146@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ajd@linux.ibm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=baohua@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=chleroy@kernel.org \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=jiangwen6@xiaomi.com \
    --cc=jiangwenxiaomi@gmail.com \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=urezki@gmail.com \
    --cc=will@kernel.org \
    --cc=xueyuan.chen21@gmail.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