lkml.org 
[lkml]   [2022]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.18 0137/1095] arm64: Do not forget syscall when starting a new thread.
    Date
    From: Francis Laniel <flaniel@linux.microsoft.com>

    [ Upstream commit de6921856f99c11d3986c6702d851e1328d4f7f6 ]

    Enable tracing of the execve*() system calls with the
    syscalls:sys_exit_execve tracepoint by removing the call to
    forget_syscall() when starting a new thread and preserving the value of
    regs->syscallno across exec.

    Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
    Link: https://lore.kernel.org/r/20220608162447.666494-2-flaniel@linux.microsoft.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/arm64/include/asm/processor.h | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
    index 6b1a12c23fe7..7058bf047fa5 100644
    --- a/arch/arm64/include/asm/processor.h
    +++ b/arch/arm64/include/asm/processor.h
    @@ -250,8 +250,9 @@ void tls_preserve_current_state(void);

    static inline void start_thread_common(struct pt_regs *regs, unsigned long pc)
    {
    + s32 previous_syscall = regs->syscallno;
    memset(regs, 0, sizeof(*regs));
    - forget_syscall(regs);
    + regs->syscallno = previous_syscall;
    regs->pc = pc;

    if (system_uses_irq_prio_masking())
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-08-15 22:28    [W:4.113 / U:0.724 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site