]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arm64: ptrace: Avoid setting compat FP[SC]R to garbage if get_user fails
authorDave Martin <Dave.Martin@arm.com>
Thu, 29 Jun 2017 14:25:47 +0000 (15:25 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 29 Jun 2017 16:44:08 +0000 (17:44 +0100)
commit53b1a742ed251780267a57415bc955bd50f40c3d
treed3f864d5ac31202d46312bf85ae8bea7533b39e6
parent15ad6ace52039c7e39435c4d712d147126604a97
arm64: ptrace: Avoid setting compat FP[SC]R to garbage if get_user fails

If get_user() fails when reading the new FPSCR value from userspace
in compat_vfp_get(), then garbage* will be written to the task's
FPSR and FPCR registers.

This patch prevents this by checking the return from get_user()
first.

[*] Actually, zero, due to the behaviour of get_user() on error, but
that's still not what userspace expects.

Fixes: 478fcb2cdb23 ("arm64: Debugging support")
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/ptrace.c