mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
There will be a VDSO function to unlock non-contended robust futexes in user space. The unlock sequence is racy vs. clearing the list_pending_op pointer in the task's robust list head. To plug this race the kernel needs to know the critical section window so it can clear the pointer when the task is interrupted within that race window. The window is determined by labels in the inline assembly. Add these symbols to the vdso2c generator and use them in the VDSO VMA code to update the critical section addresses in mm_struct::futex on (re)map(). The symbols are not exported to user space, but available in the debug version of the vDSO. Signed-off-by: Thomas Gleixner <tglx@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: André Almeida <andrealmeid@igalia.com> Link: https://patch.msgid.link/20260602090535.828312645@kernel.org
47 lines
1.2 KiB
C
47 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_X86_VDSO_H
|
|
#define _ASM_X86_VDSO_H
|
|
|
|
#include <asm/page_types.h>
|
|
#include <linux/linkage.h>
|
|
#include <linux/init.h>
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#include <linux/mm_types.h>
|
|
|
|
struct vdso_image {
|
|
void *data;
|
|
unsigned long size; /* Always a multiple of PAGE_SIZE */
|
|
|
|
unsigned long alt, alt_len;
|
|
unsigned long extable_base, extable_len;
|
|
const void *extable;
|
|
|
|
long sym___kernel_sigreturn;
|
|
long sym___kernel_rt_sigreturn;
|
|
long sym___kernel_vsyscall;
|
|
long sym_int80_landing_pad;
|
|
long sym_vdso32_sigreturn_landing_pad;
|
|
long sym_vdso32_rt_sigreturn_landing_pad;
|
|
long sym___futex_list64_try_unlock_cs_start;
|
|
long sym___futex_list64_try_unlock_cs_end;
|
|
long sym___futex_list32_try_unlock_cs_start;
|
|
long sym___futex_list32_try_unlock_cs_end;
|
|
};
|
|
|
|
extern const struct vdso_image vdso64_image;
|
|
extern const struct vdso_image vdsox32_image;
|
|
extern const struct vdso_image vdso32_image;
|
|
|
|
extern int __init init_vdso_image(const struct vdso_image *image);
|
|
|
|
extern int map_vdso_once(const struct vdso_image *image, unsigned long addr);
|
|
|
|
extern bool fixup_vdso_exception(struct pt_regs *regs, int trapnr,
|
|
unsigned long error_code,
|
|
unsigned long fault_addr);
|
|
#endif /* __ASSEMBLER__ */
|
|
|
|
#endif /* _ASM_X86_VDSO_H */
|