Anything before enter_from_user_mode() is not safe to be traced or probed.
Signed-off-by: Thomas Gleixner <[email protected]>
---
arch/x86/entry/common.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -314,11 +314,12 @@ void do_syscall_64_irqs_on(unsigned long
syscall_return_slowpath(regs);
}
-__visible void do_syscall_64(unsigned long nr, struct pt_regs *regs)
+__visible notrace void do_syscall_64(unsigned long nr, struct pt_regs *regs)
{
syscall_entry_fixups();
do_syscall_64_irqs_on(nr, regs);
}
+NOKPROBE_SYMBOL(do_syscall_64);
#endif
#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
@@ -369,11 +370,12 @@ static __always_inline void do_syscall_3
}
/* Handles int $0x80 */
-__visible void do_int80_syscall_32(struct pt_regs *regs)
+__visible notrace void do_int80_syscall_32(struct pt_regs *regs)
{
syscall_entry_fixups();
do_syscall_32_irqs_on(regs);
}
+NOKPROBE_SYMBOL(do_int80_syscall_32);
/* Fast syscall 32bit variant */
static __always_inline long do_fast_syscall_32_irqs_on(struct pt_regs *regs)
@@ -449,10 +451,11 @@ static __always_inline long do_fast_sysc
}
/* Returns 0 to return using IRET or 1 to return using SYSEXIT/SYSRETL. */
-__visible long do_fast_syscall_32(struct pt_regs *regs)
+__visible notrace long do_fast_syscall_32(struct pt_regs *regs)
{
syscall_entry_fixups();
return do_fast_syscall_32_irqs_on(regs);
}
+NOKPROBE_SYMBOL(do_fast_syscall_32);
#endif /* CONFIG_X86_32 || CONFIG_IA32_EMULATION */
On Tue, Feb 25, 2020 at 11:08:04PM +0100, Thomas Gleixner wrote:
> Anything before enter_from_user_mode() is not safe to be traced or probed.
Perhaps the changelog should clarify as to why exactly it isn't
safe to trace before enter_from_user_mode(). There have been
so many patches on that lately that I'm not clear on that either.
Thanks.
On 2/25/20 11:08 PM, Thomas Gleixner wrote:
> Anything before enter_from_user_mode() is not safe to be traced or probed.
>
> Signed-off-by: Thomas Gleixner <[email protected]>
> ---
> arch/x86/entry/common.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
Reviewed-by: Alexandre Chartre <[email protected]>
alex.