• Heiko Carstens's avatar
    s390/ptrace: fix guarded storage regset handling · 5ef2d523
    Heiko Carstens authored
    If the guarded storage regset for current is supposed to be changed,
    the regset from user space is copied directly into the guarded storage
    control block.
    
    If then the process gets scheduled away while the control block is
    being copied and before the new control block has been loaded, the
    result is random: the process can be scheduled away due to a page
    fault or preemption. If that happens the already copied parts will be
    overwritten by save_gs_cb(), called from switch_to().
    
    Avoid this by copying the data to a temporary buffer on the stack and
    do the actual update with preemption disabled.
    
    Fixes: f5bbd721 ("s390/ptrace: guarded storage regset for the current task")
    Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    5ef2d523
ptrace.c 42.9 KB