From ee3b39c92454b0360a614bd017eb5e545ea61f4e Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 4 Sep 2025 11:30:53 +0200 Subject: linux-user: Create vdso_sigreturn_region_{start,end} These variables will be populated from the vdso, and used for detecting whether we are executing the sigreturn. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux-user/elfload.c') diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 26c090c95d..28f0909d1a 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1659,6 +1659,11 @@ static void load_elf_vdso(struct image_info *info, const VdsoImageInfo *vdso) if (vdso->rt_sigreturn_ofs) { default_rt_sigreturn = load_addr + vdso->rt_sigreturn_ofs; } + if (vdso->sigreturn_region_start_ofs) { + vdso_sigreturn_region_start = + load_addr + vdso->sigreturn_region_start_ofs; + vdso_sigreturn_region_end = load_addr + vdso->sigreturn_region_end_ofs; + } /* Remove write from VDSO segment. */ target_mprotect(info->start_data, info->end_data - info->start_data, -- cgit 1.4.1 From 2c75137623cb60f2ac3cedfff077d00dc977b842 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 4 Sep 2025 12:11:45 +0200 Subject: linux-user: Populate vdso_sigreturn_region_{start,end} from sigtramp page When a target does not support a vdso, we generate a sigtramp page. The only thing on this page is a (set of) signal return syscalls. We do not need to narrowly restrict the vdso_sigreturn_region; simply record the entire page for all such targets. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux-user/elfload.c') diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 28f0909d1a..1370ec59be 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1974,6 +1974,8 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info) setup_sigtramp(tramp_page); target_mprotect(tramp_page, TARGET_PAGE_SIZE, PROT_READ | PROT_EXEC); + vdso_sigreturn_region_start = tramp_page; + vdso_sigreturn_region_end = tramp_page + TARGET_PAGE_SIZE; } bprm->p = create_elf_tables(bprm->p, bprm->argc, bprm->envc, &ehdr, info, -- cgit 1.4.1