Commit a90c07d6 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

fault/vdso/restorer: add force-injection of trampolines

To check that jump trampolines to rt-vdso works.
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent d4a60bb2
...@@ -11,6 +11,7 @@ enum faults { ...@@ -11,6 +11,7 @@ enum faults {
FI_PARASITE_CONNECT, FI_PARASITE_CONNECT,
FI_POST_RESTORE, FI_POST_RESTORE,
/* not fatal */ /* not fatal */
FI_VDSO_TRAMPOLINES = 127,
FI_CHECK_OPEN_HANDLE = 128, FI_CHECK_OPEN_HANDLE = 128,
FI_NO_MEMFD = 129, FI_NO_MEMFD = 129,
FI_NO_BREAKPOINTS = 130, FI_NO_BREAKPOINTS = 130,
......
...@@ -83,7 +83,8 @@ extern int vdso_do_park(struct vdso_symtable *sym_rt, unsigned long park_at, uns ...@@ -83,7 +83,8 @@ extern int vdso_do_park(struct vdso_symtable *sym_rt, unsigned long park_at, uns
extern int vdso_map_compat(unsigned long map_at); extern int vdso_map_compat(unsigned long map_at);
extern int vdso_proxify(struct vdso_symtable *sym_rt, extern int vdso_proxify(struct vdso_symtable *sym_rt,
unsigned long vdso_rt_parked_at, unsigned long vdso_rt_parked_at,
VmaEntry *vmas, size_t nr_vmas, bool compat_vdso); VmaEntry *vmas, size_t nr_vmas,
bool compat_vdso, bool force_trampolines);
#else /* CONFIG_VDSO */ #else /* CONFIG_VDSO */
#define vdso_do_park(sym_rt, park_at, park_size) (0) #define vdso_do_park(sym_rt, park_at, park_size) (0)
......
...@@ -103,9 +103,9 @@ int __vdso_fill_symtable(uintptr_t mem, size_t size, ...@@ -103,9 +103,9 @@ int __vdso_fill_symtable(uintptr_t mem, size_t size,
} }
#endif #endif
int vdso_proxify(struct vdso_symtable *sym_rt, int vdso_proxify(struct vdso_symtable *sym_rt, unsigned long vdso_rt_parked_at,
unsigned long vdso_rt_parked_at, VmaEntry *vmas, size_t nr_vmas,
VmaEntry *vmas, size_t nr_vmas, bool compat_vdso) bool compat_vdso, bool force_trampolines)
{ {
VmaEntry *vma_vdso = NULL, *vma_vvar = NULL; VmaEntry *vma_vdso = NULL, *vma_vvar = NULL;
struct vdso_symtable s = VDSO_SYMTABLE_INIT; struct vdso_symtable s = VDSO_SYMTABLE_INIT;
...@@ -193,7 +193,7 @@ int vdso_proxify(struct vdso_symtable *sym_rt, ...@@ -193,7 +193,7 @@ int vdso_proxify(struct vdso_symtable *sym_rt,
* by a caller code. So drop VMA_AREA_REGULAR from it and caller would * by a caller code. So drop VMA_AREA_REGULAR from it and caller would
* not touch it anymore. * not touch it anymore.
*/ */
if (remap_rt) { if (remap_rt && !force_trampolines) {
int ret = 0; int ret = 0;
pr_info("Runtime vdso/vvar matches dumpee, remap inplace\n"); pr_info("Runtime vdso/vvar matches dumpee, remap inplace\n");
......
...@@ -1193,7 +1193,8 @@ long __export_restore_task(struct task_restore_args *args) ...@@ -1193,7 +1193,8 @@ long __export_restore_task(struct task_restore_args *args)
* Proxify vDSO. * Proxify vDSO.
*/ */
if (vdso_proxify(&args->vdso_sym_rt, args->vdso_rt_parked_at, if (vdso_proxify(&args->vdso_sym_rt, args->vdso_rt_parked_at,
args->vmas, args->vmas_n, args->compatible_mode)) args->vmas, args->vmas_n, args->compatible_mode,
fault_injected(FI_VDSO_TRAMPOLINES)))
goto core_restore_end; goto core_restore_end;
#endif #endif
......
...@@ -9,6 +9,7 @@ prep ...@@ -9,6 +9,7 @@ prep
./test/zdtm.py run -t zdtm/static/inotify_irmap --fault 128 --keep-going --pre 2 -f uns || fail ./test/zdtm.py run -t zdtm/static/inotify_irmap --fault 128 --keep-going --pre 2 -f uns || fail
./test/zdtm.py run -t zdtm/static/env00 --fault 129 -f uns || fail ./test/zdtm.py run -t zdtm/static/env00 --fault 129 -f uns || fail
./test/zdtm.py run -t zdtm/transition/fork --fault 130 -f h || fail ./test/zdtm.py run -t zdtm/transition/fork --fault 130 -f h || fail
./test/zdtm.py run -t zdtm/static/vdso01 --fault 127 || fail
./test/zdtm.py run -t zdtm/static/mntns_ghost --fault 2 --keep-going --report report || fail ./test/zdtm.py run -t zdtm/static/mntns_ghost --fault 2 --keep-going --report report || fail
./test/zdtm.py run -t zdtm/static/mntns_ghost --fault 4 --keep-going --report report || fail ./test/zdtm.py run -t zdtm/static/mntns_ghost --fault 4 --keep-going --report report || fail
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment