Skip to content

Commit 333e71c

Browse files
Martin Schwidefskygregkh
authored andcommitted
s390: fix test_fp_ctl inline assembly contraints
commit bcf4dd5f9ee096bd1510f838dd4750c35df4e38b upstream. The test_fp_ctl function is used to test if a given value is a valid floating-point control. The inline assembly in test_fp_ctl uses an incorrect constraint for the 'orig_fpc' variable. If the compiler chooses the same register for 'fpc' and 'orig_fpc' the test_fp_ctl() function always returns true. This allows user space to trigger kernel oopses with invalid floating-point control values on the signal stack. This problem has been introduced with git commit 4725c86 "s390: fix save and restore of the floating-point-control register" Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 273e129 commit 333e71c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • arch/s390/include/asm/fpu

arch/s390/include/asm/fpu/api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static inline int test_fp_ctl(u32 fpc)
2222
" la %0,0\n"
2323
"1:\n"
2424
EX_TABLE(0b,1b)
25-
: "=d" (rc), "=d" (orig_fpc)
25+
: "=d" (rc), "=&d" (orig_fpc)
2626
: "d" (fpc), "0" (-EINVAL));
2727
return rc;
2828
}

0 commit comments

Comments
 (0)