From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752729AbbBYI2k (ORCPT ); Wed, 25 Feb 2015 03:28:40 -0500 Received: from terminus.zytor.com ([198.137.202.10]:39019 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229AbbBYI2i (ORCPT ); Wed, 25 Feb 2015 03:28:38 -0500 Date: Wed, 25 Feb 2015 00:27:40 -0800 From: tip-bot for Andy Lutomirski Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, mingo@kernel.org, bp@alien8.de, tglx@linutronix.de, luto@amacapital.net Reply-To: hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, dvlasenk@redhat.com, bp@alien8.de, luto@amacapital.net, tglx@linutronix.de In-Reply-To: <71c7ab36456855d11ae07edd4945a7dfe80f9915.1424822291.git.luto@amacapital.net> References: <71c7ab36456855d11ae07edd4945a7dfe80f9915.1424822291.git.luto@amacapital.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/ptrace: Remove checks for TIF_IA32 when changing CS and SS Git-Commit-ID: 08571f1ae327bfb631cb7171bde5ea605df626c6 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 08571f1ae327bfb631cb7171bde5ea605df626c6 Gitweb: http://git.kernel.org/tip/08571f1ae327bfb631cb7171bde5ea605df626c6 Author: Andy Lutomirski AuthorDate: Tue, 24 Feb 2015 16:01:38 -0800 Committer: Ingo Molnar CommitDate: Wed, 25 Feb 2015 08:27:49 +0100 x86/ptrace: Remove checks for TIF_IA32 when changing CS and SS The ability for modified CS and/or SS to be useful has nothing to do with TIF_IA32. Similarly, if there's an exploit involving changing CS or SS, it's exploitable with or without a TIF_IA32 check. So just delete the check. Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Denys Vlasenko Link: http://lkml.kernel.org/r/71c7ab36456855d11ae07edd4945a7dfe80f9915.1424822291.git.luto@amacapital.net Signed-off-by: Ingo Molnar --- arch/x86/kernel/ptrace.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index e510618..1e12581 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -364,18 +364,12 @@ static int set_segment_reg(struct task_struct *task, case offsetof(struct user_regs_struct,cs): if (unlikely(value == 0)) return -EIO; -#ifdef CONFIG_IA32_EMULATION - if (test_tsk_thread_flag(task, TIF_IA32)) - task_pt_regs(task)->cs = value; -#endif + task_pt_regs(task)->cs = value; break; case offsetof(struct user_regs_struct,ss): if (unlikely(value == 0)) return -EIO; -#ifdef CONFIG_IA32_EMULATION - if (test_tsk_thread_flag(task, TIF_IA32)) - task_pt_regs(task)->ss = value; -#endif + task_pt_regs(task)->ss = value; break; }