Skip to content

Commit 324373f

Browse files
guoren83palmer-dabbelt
authored andcommitted
riscv: compat: Using seperated vdso_maps for compat_vdso_info
This is a fixup for vdso implementation which caused musl to fail. [ 11.600082] Run /sbin/init as init process [ 11.628561] init[1]: unhandled signal 11 code 0x1 at 0x0000000000000000 in libc.so[ffffff8ad39000+a4000] [ 11.629398] CPU: 0 PID: 1 Comm: init Not tainted 5.18.0-rc7-next-20220520 #1 [ 11.629462] Hardware name: riscv-virtio,qemu (DT) [ 11.629546] epc : 00ffffff8ada1100 ra : 00ffffff8ada13c8 sp : 00ffffffc58199f0 [ 11.629586] gp : 00ffffff8ad39000 tp : 00ffffff8ade0998 t0 : ffffffffffffffff [ 11.629598] t1 : 00ffffffc5819fd0 t2 : 0000000000000000 s0 : 00ffffff8ade0cc0 [ 11.629610] s1 : 00ffffff8ade0cc0 a0 : 0000000000000000 a1 : 00ffffffc5819a00 [ 11.629622] a2 : 0000000000000001 a3 : 000000000000001e a4 : 00ffffffc5819b00 [ 11.629634] a5 : 00ffffffc5819b00 a6 : 0000000000000000 a7 : 0000000000000000 [ 11.629645] s2 : 00ffffff8ade0ac8 s3 : 00ffffff8ade0ec8 s4 : 00ffffff8ade0728 [ 11.629656] s5 : 00ffffff8ade0a90 s6 : 0000000000000000 s7 : 00ffffffc5819e40 [ 11.629667] s8 : 00ffffff8ade0ca0 s9 : 00ffffff8addba50 s10: 0000000000000000 [ 11.629678] s11: 0000000000000000 t3 : 0000000000000002 t4 : 0000000000000001 [ 11.629688] t5 : 0000000000020000 t6 : ffffffffffffffff [ 11.629699] status: 0000000000004020 badaddr: 0000000000000000 cause: 000000000000000d The last __vdso_init(&compat_vdso_info) replaces the data in normal vdso_info. This is an obvious bug. Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Guo Ren <[email protected]> Signed-off-by: Guo Ren <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Tested-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 3092eb4 ("riscv: compat: vdso: Add setup additional pages implementation") Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 8810d7f commit 324373f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

arch/riscv/kernel/vdso.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,23 @@ static struct __vdso_info vdso_info __ro_after_init = {
206206
};
207207

208208
#ifdef CONFIG_COMPAT
209+
static struct vm_special_mapping rv_compat_vdso_maps[] __ro_after_init = {
210+
[RV_VDSO_MAP_VVAR] = {
211+
.name = "[vvar]",
212+
.fault = vvar_fault,
213+
},
214+
[RV_VDSO_MAP_VDSO] = {
215+
.name = "[vdso]",
216+
.mremap = vdso_mremap,
217+
},
218+
};
219+
209220
static struct __vdso_info compat_vdso_info __ro_after_init = {
210221
.name = "compat_vdso",
211222
.vdso_code_start = compat_vdso_start,
212223
.vdso_code_end = compat_vdso_end,
213-
.dm = &rv_vdso_maps[RV_VDSO_MAP_VVAR],
214-
.cm = &rv_vdso_maps[RV_VDSO_MAP_VDSO],
224+
.dm = &rv_compat_vdso_maps[RV_VDSO_MAP_VVAR],
225+
.cm = &rv_compat_vdso_maps[RV_VDSO_MAP_VDSO],
215226
};
216227
#endif
217228

0 commit comments

Comments
 (0)