mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
resume_user_mode: Move to resume_user_mode.h
Move set_notify_resume and tracehook_notify_resume into resume_user_mode.h. While doing that rename tracehook_notify_resume to resume_user_mode_work. Update all of the places that included tracehook.h for these functions to include resume_user_mode.h instead. Update all of the callers of tracehook_notify_resume to call resume_user_mode_work. Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lkml.kernel.org/r/20220309162454.123006-12-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
@@ -218,7 +218,7 @@ config TRACE_IRQFLAGS_SUPPORT
|
||||
# linux/regset.h user_regset interfaces
|
||||
# CORE_DUMP_USE_REGSET #define'd in linux/elf.h
|
||||
# TIF_SYSCALL_TRACE calls ptrace_report_syscall_{entry,exit}
|
||||
# TIF_NOTIFY_RESUME calls tracehook_notify_resume()
|
||||
# TIF_NOTIFY_RESUME calls resume_user_mode_work()
|
||||
#
|
||||
config HAVE_ARCH_TRACEHOOK
|
||||
bool
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <linux/binfmts.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/sigcontext.h>
|
||||
@@ -531,7 +531,7 @@ do_work_pending(struct pt_regs *regs, unsigned long thread_flags,
|
||||
do_signal(regs, r0, r19);
|
||||
r0 = 0;
|
||||
} else {
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
}
|
||||
local_irq_disable();
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <linux/personality.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
#include <linux/sched/task_stack.h>
|
||||
|
||||
#include <asm/ucontext.h>
|
||||
@@ -438,5 +438,5 @@ void do_notify_resume(struct pt_regs *regs)
|
||||
* user mode
|
||||
*/
|
||||
if (test_thread_flag(TIF_NOTIFY_RESUME))
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <linux/signal.h>
|
||||
#include <linux/personality.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
#include <linux/uprobes.h>
|
||||
#include <linux/syscalls.h>
|
||||
|
||||
@@ -627,7 +627,7 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
|
||||
} else if (thread_flags & _TIF_UPROBE) {
|
||||
uprobe_notify_resume(regs);
|
||||
} else {
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
}
|
||||
local_irq_disable();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
#include <linux/ratelimit.h>
|
||||
#include <linux/syscalls.h>
|
||||
|
||||
@@ -941,7 +941,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags)
|
||||
do_signal(regs);
|
||||
|
||||
if (thread_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
|
||||
if (thread_flags & _TIF_FOREIGN_FPSTATE)
|
||||
fpsimd_restore_current_state();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <linux/signal.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
#include <asm/traps.h>
|
||||
#include <asm/ucontext.h>
|
||||
@@ -265,5 +265,5 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
|
||||
do_signal(regs);
|
||||
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <linux/personality.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/binfmts.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <linux/uaccess.h>
|
||||
@@ -283,5 +283,5 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags)
|
||||
do_signal(regs);
|
||||
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <linux/tick.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
/*
|
||||
* Program thread launch. Often defined as a macro in processor.h,
|
||||
@@ -178,7 +178,7 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
|
||||
}
|
||||
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/sched/task_stack.h>
|
||||
|
||||
#include <asm/registers.h>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kdebug.h>
|
||||
#include <linux/utsname.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
#include <asm/cpu.h>
|
||||
@@ -179,7 +179,7 @@ do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long in_syscall)
|
||||
|
||||
if (test_thread_flag(TIF_NOTIFY_RESUME)) {
|
||||
local_irq_enable(); /* force interrupt enable */
|
||||
tracehook_notify_resume(&scr->pt);
|
||||
resume_user_mode_work(&scr->pt);
|
||||
}
|
||||
|
||||
/* copy user rbs to kernel rbs */
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <linux/signal.h>
|
||||
#include <linux/regset.h>
|
||||
#include <linux/elf.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/ptrace_offsets.h>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/smp.h>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include <linux/tty.h>
|
||||
#include <linux/binfmts.h>
|
||||
#include <linux/extable.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <linux/uaccess.h>
|
||||
@@ -1109,5 +1109,5 @@ void do_notify_resume(struct pt_regs *regs)
|
||||
do_signal(regs);
|
||||
|
||||
if (test_thread_flag(TIF_NOTIFY_RESUME))
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <linux/personality.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
#include <asm/entry.h>
|
||||
#include <asm/ucontext.h>
|
||||
#include <linux/uaccess.h>
|
||||
@@ -311,5 +311,5 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall)
|
||||
do_signal(regs, in_syscall);
|
||||
|
||||
if (test_thread_flag(TIF_NOTIFY_RESUME))
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
#include <asm/abi.h>
|
||||
#include <asm/asm.h>
|
||||
@@ -916,7 +916,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
|
||||
do_signal(regs);
|
||||
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
|
||||
user_enter();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/personality.h>
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
@@ -380,5 +380,5 @@ do_notify_resume(struct pt_regs *regs, unsigned int thread_flags)
|
||||
do_signal(regs);
|
||||
|
||||
if (thread_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/personality.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
#include <asm/ucontext.h>
|
||||
#include <asm/cacheflush.h>
|
||||
@@ -319,7 +319,7 @@ asmlinkage int do_notify_resume(struct pt_regs *regs)
|
||||
return restart;
|
||||
}
|
||||
} else if (test_thread_flag(TIF_NOTIFY_RESUME))
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/syscall.h>
|
||||
@@ -309,7 +309,7 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
|
||||
}
|
||||
syscall = 0;
|
||||
} else {
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
}
|
||||
local_irq_disable();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <linux/errno.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/compat.h>
|
||||
@@ -602,5 +602,5 @@ void do_notify_resume(struct pt_regs *regs, long in_syscall)
|
||||
do_signal(regs, in_syscall);
|
||||
|
||||
if (test_thread_flag(TIF_NOTIFY_RESUME))
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* this archive for more details.
|
||||
*/
|
||||
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/resume_user_mode.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/uprobes.h>
|
||||
#include <linux/key.h>
|
||||
@@ -294,7 +294,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
|
||||
}
|
||||
|
||||
if (thread_info_flags & _TIF_NOTIFY_RESUME)
|
||||
tracehook_notify_resume(regs);
|
||||
resume_user_mode_work(regs);
|
||||
}
|
||||
|
||||
static unsigned long get_tm_stackpointer(struct task_struct *tsk)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user