vdso/datastore: Zero out newly allocated datastore pages
PATCH 1/1 vdso/datastore: Zero out newly allocated datastore pages
The data pages need to be zeroed initially, as garbage data can break the vDSO userspace logic.
---
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(-)
lib/vdso/datastore.c +1 -1
@@ -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,
Signature · 1 line
Thomas Weißschuh <[email protected]>
Hi,
please disregard this patch...
Quoted 11 lines · Thomas Weißschuh
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")Signed-off-by Thomas Weißschuh <[email protected]>---
I messed up and dropped__GFP_ZEROagain when switching fromfolio_alloc()toalloc_pages()in v6 of "sparc64: vdso: Switch to the generic vDSO library" Previously the missing__GFP_ZEROtriggered boot-failures in -next, but apparently withalloc_pages()we got "lucky" so far.
... I panicked a bit after looking at the code again and not seeing the explicit zeroing. The actually works fine, as the memcpy() from the static vdso_initdata will do the zeroing.
Sorry for the noise.
Thomas
Thomas Gleixner
maintainerQuoted 12 lines · Thomas Weißschuh
Quoted 11 lines
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")Signed-off-by Thomas Weißschuh <[email protected]>---
I messed up and dropped__GFP_ZEROagain when switching fromfolio_alloc()toalloc_pages()in v6 of "sparc64: vdso: Switch to the generic vDSO library" Previously the missing__GFP_ZEROtriggered boot-failures in -next, but apparently withalloc_pages()we got "lucky" so far.
Quoted 5 lines
... I panicked a bit after looking at the code again and not seeing the explicit zeroing. The actually works fine, as the
memcpy()from the staticvdso_initdatawill do the zeroing.Sorry for the noise.
Happens to all of us. Better safe than sorry six weeks down the road.