All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mm/vmalloc: harden remap_vmalloc_range_partial against NULL pages
@ 2026-10-29  9:19 Ye Liu
  2026-10-29  9:19 ` [PATCH v2 1/2] mm/vmalloc: drop VM_DMA_COHERENT from remap_vmalloc_range_partial Ye Liu
  2026-10-29  9:19 ` [PATCH v2 2/2] mm/vmalloc: reject NULL pages in remap_vmalloc_range_partial Ye Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Ye Liu @ 2026-10-29  9:19 UTC (permalink / raw)
  To: Andrew Morton, Uladzislau Rezki
  Cc: linux-mm, linux-kernel, Ye Liu, Jose A. Perez de Azpillaga

remap_vmalloc_range_partial() passes vmalloc_to_page()'s result to
vm_insert_page() unchecked, oopsing via page_folio() if the page is
NULL. The NULL case never happens today because VM_USERMAP areas keep
every page mapped, but that assumption is nowhere checked.

Patch 1 drops VM_DMA_COHERENT from the allow-list -- a dead entry (no
caller maps a DMA-coherent area through this path).

Patch 2 fails the mapping with -EINVAL instead of oopsing if
vmalloc_to_page() ever returns NULL, with a WARN to mark the broken
invariant.

Patch 1 is a behavior change (no in-tree caller affected)
Patch 2 only changes a failure path that cannot be reached today. 
The two are independent.

Signed-off-by: Ye Liu <liuye@kylinos.cn>
---
Changes in v2:
- patch 1: drop the vrealloc-shrink justification. 
- patch 2: fail with -EINVAL rather than oopsing.
- Link to v1: https://patch.msgid.link/20261026-vmalloc_remap-v1-0-b7a907814e90@linux.dev

---
Ye Liu (2):
      mm/vmalloc: drop VM_DMA_COHERENT from remap_vmalloc_range_partial
      mm/vmalloc: reject NULL pages in remap_vmalloc_range_partial

 mm/vmalloc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64
change-id: 20261026-vmalloc_remap-012cf418c2a8

Best regards,
--  
Ye Liu <ye.liu@linux.dev>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-29 12:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29  9:19 [PATCH v2 0/2] mm/vmalloc: harden remap_vmalloc_range_partial against NULL pages Ye Liu
2026-10-29  9:19 ` [PATCH v2 1/2] mm/vmalloc: drop VM_DMA_COHERENT from remap_vmalloc_range_partial Ye Liu
2026-10-29 11:57   ` Jose A. Perez de Azpillaga
2026-10-29  9:19 ` [PATCH v2 2/2] mm/vmalloc: reject NULL pages in remap_vmalloc_range_partial Ye Liu
2026-10-29 12:04   ` Jose A. Perez de Azpillaga

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.