Commit 89557831 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Ben Hutchings

s390: fix test_fp_ctl inline assembly contraints

commit bcf4dd5f 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 4725c860
"s390: fix save and restore of the floating-point-control register"
Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 08015658
...@@ -28,7 +28,7 @@ static inline int test_fp_ctl(u32 fpc) ...@@ -28,7 +28,7 @@ static inline int test_fp_ctl(u32 fpc)
" la %0,0\n" " la %0,0\n"
"1:\n" "1:\n"
EX_TABLE(0b,1b) EX_TABLE(0b,1b)
: "=d" (rc), "=d" (orig_fpc) : "=d" (rc), "=&d" (orig_fpc)
: "d" (fpc), "0" (-EINVAL)); : "d" (fpc), "0" (-EINVAL));
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment