From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751285AbdIWJJO (ORCPT ); Sat, 23 Sep 2017 05:09:14 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37341 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750766AbdIWJJL (ORCPT ); Sat, 23 Sep 2017 05:09:11 -0400 X-Google-Smtp-Source: AOwi7QCic1RzBxeySJWjzzjrllCwjzRB3as3MaF/nmgFxaJt5BkwK+iMyNGsmyXYZ3Cg6vZRFh5M9A== Date: Sat, 23 Sep 2017 11:09:07 +0200 From: Ingo Molnar To: Eric Biggers Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Andy Lutomirski , Dave Hansen , Dmitry Vyukov , Fenghua Yu , Kevin Hao , Oleg Nesterov , Wanpeng Li , Yu-cheng Yu , Michael Halcrow , Eric Biggers Subject: Re: [PATCH v4 0/3] x86/fpu: prevent leaking FPU registers via invalid FPU state Message-ID: <20170923090907.kk6hgbmupkeftae2@gmail.com> References: <20170922174156.16780-1-ebiggers3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170922174156.16780-1-ebiggers3@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Eric Biggers wrote: > From: Eric Biggers > > This series fixes the bug found by syzkaller where the ptrace syscall > can be used to set invalid bits in a task's FPU state. I also found > that an equivalent bug was reachable using the sigreturn syscall, so the > first patch fixes the bug in both cases. > > The other two patches start validating the other parts of the > xstate_header and make it so that invalid FPU states can no longer be > abused to leak the FPU registers of other processes. > > Changes since v3: > - Rebase onto tip/master > > Changes since v2: > - Use an exception handler to handle invalid FPU states > (suggested by Andy Lutomirski) > - Check the size of xstate_header.reserved at build time > (suggested by Dave Hansen) > > Eric Biggers (3): > x86/fpu: don't let userspace set bogus xcomp_bv > x86/fpu: tighten validation of user-supplied xstate_header > x86/fpu: reinitialize FPU registers if restoring FPU state fails > > arch/x86/include/asm/fpu/internal.h | 51 +++++++++++------------------------- > arch/x86/include/asm/fpu/xstate.h | 25 ++++++++++++++++++ > arch/x86/kernel/fpu/regset.c | 17 +++++------- > arch/x86/kernel/fpu/signal.c | 18 ++++++++----- > arch/x86/kernel/fpu/xstate.c | 52 ++++++++++++++----------------------- > arch/x86/mm/extable.c | 24 +++++++++++++++++ > 6 files changed, 102 insertions(+), 85 deletions(-) Thank you Eric - I've applied them and will push it all out together with the other pending bits in WIP.x86/fpu. Ingo