• Dave Martin's avatar
    arm64: ptrace: Flush FPSIMD regs back to thread_struct before reading · e1d5a8fb
    Dave Martin authored
    When reading the FPSIMD state of current (which occurs when dumping
    core), it is possible that userspace has modified the FPSIMD
    registers since the time the task was last scheduled out.  Such
    changes are not guaranteed to be reflected immedately in
    thread_struct.
    
    As a result, a coredump can contain stale values for these
    registers.  Reading the registers of a stopped task via ptrace is
    unaffected.
    
    This patch explicitly flushes the CPU state back to thread_struct
    before dumping when operating on current, thus ensuring that
    coredump contents are up to date.
    Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    e1d5a8fb
ptrace.c 34.4 KB