mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
To: Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	 Vincenzo Frascino <vincenzo.frascino@arm.com>,
	 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: [PATCH] vdso/datastore: Zero out newly allocated datastore pages
Date: Thu, 09 Apr 2026 13:14:05 +0200	[thread overview]
Message-ID: <20260409-vdso-datastore-zero-v1-1-e7b64a7c54b5@linutronix.de> (raw)

The data pages need to be zeroed initially, as garbage data can break
the vDSO userspace logic.

Fixes: 05988dba1179 ("vdso/datastore: Allocate data pages dynamically")
Link: https://lore.kernel.org/lkml/aQjJNmwniQwwjeBR@finisterre.sirena.org.uk/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
I messed up and dropped __GFP_ZERO again when switching from folio_alloc() to
alloc_pages() in v6 of "sparc64: vdso: Switch to the generic vDSO library"
Previously the missing __GFP_ZERO triggered boot-failures in -next, but
apparently with alloc_pages() we got "lucky" so far.

This could also be merged into the originally broken commit.
---
 lib/vdso/datastore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vdso/datastore.c b/lib/vdso/datastore.c
index cf5d784a4a5a..55f1654624e0 100644
--- a/lib/vdso/datastore.c
+++ b/lib/vdso/datastore.c
@@ -42,7 +42,7 @@ void __init vdso_setup_data_pages(void)
 	 * Do not use folios. In time namespaces the pages are mapped in a different order
 	 * to userspace, which is not handled by the folio optimizations in finish_fault().
 	 */
-	pages = alloc_pages(GFP_KERNEL, order);
+	pages = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
 	if (!pages)
 		panic("Unable to allocate VDSO storage pages");
 

---
base-commit: 7138a8698a39e81eb153e05500823fff76d5b3bd
change-id: 20260409-vdso-datastore-zero-87f0d2d482d6

Best regards,
--  
Thomas Weißschuh <thomas.weissschuh@linutronix.de>


             reply	other threads:[~2026-04-09 11:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 11:14 Thomas Weißschuh [this message]
2026-04-09 11:17 ` Thomas Weißschuh
2026-04-09 20:21   ` Thomas Gleixner

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=20260409-vdso-datastore-zero-v1-1-e7b64a7c54b5@linutronix.de \
    --to=thomas.weissschuh@linutronix.de \
    --cc=chleroy@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=tglx@kernel.org \
    --cc=vincenzo.frascino@arm.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®