• Martin Schwidefsky's avatar
    s390: fix preemption race in disable_sacf_uaccess · 9f37e797
    Martin Schwidefsky authored
    With CONFIG_PREEMPT=y there is a possible race in disable_sacf_uaccess.
    
    The new set_fs value needs to be stored the the task structure first,
    the control register update needs to be second. Otherwise a preemptive
    schedule may interrupt the code right after the control register update
    has been done and the next time the task is scheduled we get an incorrect
    value in the control register due to the old set_fs setting.
    
    Fixes: 0aaba41b ("s390: remove all code using the access register mode")
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    9f37e797
uaccess.c 11.1 KB