On Thu, 2017-09-21 at 11:52 -0700, Eric Biggers wrote: > From: Eric Biggers > > Move validation of user-supplied xstate_headers into a helper > function > and call it from both the ptrace and sigreturn syscall paths.  The > new > function also considers it to be an error if *any* reserved bits are > set, whereas before we were just clearing most of them. > > This should reduce the chance of bugs that fail to correctly validate > user-supplied XSAVE areas.  It also will expose any broken userspace > programs that set the other reserved bits; this is desirable because > such programs will lose compatibility with future CPUs and kernels if > those bits are ever used for anything.  (There shouldn't be any such > programs, and in fact in the case where the compacted format is in > use > we were already validating xfeatures.  But you never know...) > > Reviewed-by: Kees Cook > Acked-by: Dave Hansen > Cc: Andy Lutomirski > Cc: Dmitry Vyukov > Cc: Fenghua Yu > Cc: Ingo Molnar > Cc: Kevin Hao > Cc: Oleg Nesterov > Cc: Wanpeng Li > Cc: Yu-cheng Yu > Signed-off-by: Eric Biggers > Reviewed-by: Rik van Riel -- All rights reversed