summaryrefslogtreecommitdiff
path: root/include/vdso
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-02-04 13:05:38 +0100
committerThomas Gleixner <tglx@linutronix.de>2025-02-21 09:54:01 +0100
commit51d6ca373f459fa6c91743e14ae69854d844aa38 (patch)
tree72ff45b96b2ce8938aa8676fcd5a6ac7fa5791e7 /include/vdso
parentdf7fcbefa71090a276fb841ffe19b8e5f12b4767 (diff)
downloadlinux-51d6ca373f459fa6c91743e14ae69854d844aa38.tar.gz
linux-51d6ca373f459fa6c91743e14ae69854d844aa38.tar.bz2
linux-51d6ca373f459fa6c91743e14ae69854d844aa38.zip
vdso: Add generic random data storage
Extend the generic vDSO data storage with a page for the random state data. The random state data is stored in a dedicated page, as the existing storage page is only meant for time-related, time-namespace-aware data. This simplifies to access logic to not need to handle time namespaces anymore and also frees up more space in the time-related page. In case further generic vDSO data store is required it can be added to the random state page. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250204-vdso-store-rng-v3-6-13a4669dfc8c@linutronix.de
Diffstat (limited to 'include/vdso')
-rw-r--r--include/vdso/datapage.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
index b3d8087488ff..7dbc8797e3b8 100644
--- a/include/vdso/datapage.h
+++ b/include/vdso/datapage.h
@@ -144,8 +144,10 @@ extern struct vdso_time_data _timens_data[CS_BASES] __attribute__((visibility("h
extern struct vdso_rng_data _vdso_rng_data __attribute__((visibility("hidden")));
#else
extern struct vdso_time_data vdso_u_time_data[CS_BASES] __attribute__((visibility("hidden")));
+extern struct vdso_rng_data vdso_u_rng_data __attribute__((visibility("hidden")));
extern struct vdso_time_data *vdso_k_time_data;
+extern struct vdso_rng_data *vdso_k_rng_data;
#endif
/**
@@ -161,6 +163,7 @@ union vdso_data_store {
enum vdso_pages {
VDSO_TIME_PAGE_OFFSET,
VDSO_TIMENS_PAGE_OFFSET,
+ VDSO_RNG_PAGE_OFFSET,
VDSO_NR_PAGES
};
@@ -184,9 +187,16 @@ enum vdso_pages {
#else /* !__ASSEMBLY__ */
+#ifdef CONFIG_VDSO_GETRANDOM
+#define __vdso_u_rng_data PROVIDE(vdso_u_rng_data = vdso_u_data + 2 * PAGE_SIZE);
+#else
+#define __vdso_u_rng_data
+#endif
+
#define VDSO_VVAR_SYMS \
PROVIDE(vdso_u_data = . - __VDSO_PAGES * PAGE_SIZE); \
PROVIDE(vdso_u_time_data = vdso_u_data); \
+ __vdso_u_rng_data \
#endif /* !__ASSEMBLY__ */