From: Ye Liu <ye.liu@linux.dev>
To: Andrew Morton <akpm@linux-foundation.org>,
Uladzislau Rezki <urezki@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Ye Liu <liuye@kylinos.cn>
Subject: [PATCH 0/2] mm/vmalloc: harden remap_vmalloc_range_partial against NULL pages
Date: Mon, 26 Oct 2026 14:09:22 +0800 [thread overview]
Message-ID: <20261026-vmalloc_remap-v1-0-b7a907814e90@linux.dev> (raw)
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) whose presence also
opens a NULL-deref path, since VM_DMA_COHERENT is not in vrealloc's
shrink skip-list.
Patch 2 adds a WARN_ON(!page) to flag any future break at the
vmalloc_to_page() call site before the oops.
Patch 1 is a behavior change (no in-tree caller affected); Patch 2 is
dead code. The two are independent.
Signed-off-by: Ye Liu <liuye@kylinos.cn>
---
Ye Liu (2):
mm/vmalloc: drop VM_DMA_COHERENT from remap_vmalloc_range_partial
mm/vmalloc: warn on NULL page in remap_vmalloc_range_partial
mm/vmalloc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
change-id: 20261026-vmalloc_remap-012cf418c2a8
Best regards,
--
Ye Liu <ye.liu@linux.dev>
next reply other threads:[~2026-10-26 6:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 6:09 Ye Liu [this message]
2026-10-26 6:09 ` [PATCH 1/2] mm/vmalloc: drop VM_DMA_COHERENT from remap_vmalloc_range_partial Ye Liu
2026-10-26 6:09 ` [PATCH 2/2] mm/vmalloc: warn on NULL page in remap_vmalloc_range_partial Ye Liu
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=20261026-vmalloc_remap-v1-0-b7a907814e90@linux.dev \
--to=ye.liu@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=urezki@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
all inboxes | Powered by JetHome®