• Heiko Carstens's avatar
    s390/fpu: get rid of test_fp_ctl() · 70264424
    Heiko Carstens authored
    It is quite subtle to use test_fp_ctl() correctly. Therefore remove it -
    instead copy whatever new floating point control (fpc) register values are
    supposed to be used into its save area.
    
    Test the validity of the new value when loading it. If the new value is
    invalid, load the fpc register with zero.
    
    This seems to be a the best way to approach this problem. Even though this
    changes behavior:
    
    - sigreturn with an invalid fpc value on the stack will succeed, and
      continue with zero value, instead of returning with SIGSEGV
    
    - ptraced processes will also use a zero value instead of letting the
      request fail with -EINVAL
    
    However all of this seems to acceptable. After all testing of the value was
    only implemented to avoid that user space can crash the kernel. It is not
    there to test values for validity; and the assumption is that there is no
    existing user space which is doing this.
    Reviewed-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
    70264424
ptrace.c 43.5 KB