lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-80d8ae86b36791a545ca28ddc95133ea59bba6e0@git.kernel.org>
Date:   Tue, 26 Sep 2017 01:35:33 -0700
From:   tip-bot for Eric Biggers <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     luto@...nel.org, dvyukov@...gle.com, tglx@...utronix.de,
        torvalds@...ux-foundation.org, hpa@...or.com, bp@...en8.de,
        akpm@...ux-foundation.org, oleg@...hat.com,
        linux-kernel@...r.kernel.org, dave.hansen@...ux.intel.com,
        haokexin@...il.com, keescook@...omium.org, mingo@...nel.org,
        yu-cheng.yu@...el.com, ebiggers@...gle.com, mhalcrow@...gle.com,
        peterz@...radead.org, fenghua.yu@...el.com, luto@...capital.net,
        ebiggers3@...il.com, wanpeng.li@...mail.com, riel@...hat.com
Subject: [tip:x86/fpu] x86/fpu: Copy the full state_header in
 copy_kernel_to_xstate()

Commit-ID:  80d8ae86b36791a545ca28ddc95133ea59bba6e0
Gitweb:     http://git.kernel.org/tip/80d8ae86b36791a545ca28ddc95133ea59bba6e0
Author:     Eric Biggers <ebiggers@...gle.com>
AuthorDate: Sun, 24 Sep 2017 12:59:07 +0200
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 26 Sep 2017 09:43:46 +0200

x86/fpu: Copy the full state_header in copy_kernel_to_xstate()

This is in preparation to verify the full xstate header as supplied by user-space.

Signed-off-by: Eric Biggers <ebiggers@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Eric Biggers <ebiggers3@...il.com>
Cc: Fenghua Yu <fenghua.yu@...el.com>
Cc: Kees Cook <keescook@...omium.org>
Cc: Kevin Hao <haokexin@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Michael Halcrow <mhalcrow@...gle.com>
Cc: Oleg Nesterov <oleg@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rik van Riel <riel@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Wanpeng Li <wanpeng.li@...mail.com>
Cc: Yu-cheng Yu <yu-cheng.yu@...el.com>
Cc: kernel-hardening@...ts.openwall.com
Link: http://lkml.kernel.org/r/20170924105913.9157-5-mingo@kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/kernel/fpu/xstate.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 2427aee..02591b96 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -1148,11 +1148,13 @@ int copy_kernel_to_xstate(struct xregs_state *xsave, const void *kbuf)
 	int i;
 	u64 xfeatures;
 	u64 allowed_features;
+	struct xstate_header hdr;
 
 	offset = offsetof(struct xregs_state, header);
-	size = sizeof(xfeatures);
+	size = sizeof(hdr);
 
-	memcpy(&xfeatures, kbuf + offset, size);
+	memcpy(&hdr, kbuf + offset, size);
+	xfeatures = hdr.xfeatures;
 
 	/*
 	 * Reject if the user sets any disabled or supervisor features:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ