random: vDSO: add __arch_get_k_vdso_rng_data() helper for data page access
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 22 Aug 2024 07:13:11 +0000 (09:13 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 13 Sep 2024 15:28:35 +0000 (17:28 +0200)
commitb757959f192daf4d107dd5198b562032bd757a5e
tree77e094a04287a75e7ad426063d669cece02b16d2
parent81c6896049b6ca69a9e737656ac33b3fd96a277c
random: vDSO: add __arch_get_k_vdso_rng_data() helper for data page access

_vdso_data is specific to x86 and __arch_get_k_vdso_data() is provided
so that all architectures can provide the requested pointer.

Do the same with _vdso_rng_data, provide __arch_get_k_vdso_rng_data()
and don't use x86 _vdso_rng_data directly.

Until now vdso/vsyscall.h was only included by time/vsyscall.c but now
it will also be included in char/random.c, leading to a duplicate
declaration of _vdso_data and _vdso_rng_data.

To fix this issue, move the declaration in a C file. vma.c looks like
the most appropriate candidate. We don't need to replace the definitions
in vsyscall.h by declarations as declarations are already in asm/vvar.h.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
arch/x86/entry/vdso/vma.c
arch/x86/include/asm/vdso/vsyscall.h
drivers/char/random.c