Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753857AbbEKU5o (ORCPT ); Mon, 11 May 2015 16:57:44 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39617 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbbEKU5n (ORCPT ); Mon, 11 May 2015 16:57:43 -0400 Message-ID: <555117B7.6040608@zytor.com> Date: Mon, 11 May 2015 13:57:27 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Alex Henrie , Kees Cook , Doug Johnson , Thomas Gleixner , Ingo Molnar , Tyler Hicks , Al Viro , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86: Preserve iopl on fork and execve References: <1431377398-12046-1-git-send-email-alexhenrie24@gmail.com> In-Reply-To: <1431377398-12046-1-git-send-email-alexhenrie24@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1574 Lines: 46 On 05/11/2015 01:49 PM, Alex Henrie wrote: > Signed-off-by: Alex Henrie > Suggested-by: Doug Johnson > --- > arch/x86/kernel/process_32.c | 2 +- > arch/x86/kernel/process_64.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c > index 8ed2106..86bfe7c 100644 > --- a/arch/x86/kernel/process_32.c > +++ b/arch/x86/kernel/process_32.c > @@ -205,7 +205,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) > regs->cs = __USER_CS; > regs->ip = new_ip; > regs->sp = new_sp; > - regs->flags = X86_EFLAGS_IF; > + regs->flags |= X86_EFLAGS_IF; > force_iret(); > } > EXPORT_SYMBOL_GPL(start_thread); > diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c > index ddfdbf7..fc22e5d 100644 > --- a/arch/x86/kernel/process_64.c > +++ b/arch/x86/kernel/process_64.c > @@ -238,7 +238,7 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip, > regs->sp = new_sp; > regs->cs = _cs; > regs->ss = _ss; > - regs->flags = X86_EFLAGS_IF; > + regs->flags |= X86_EFLAGS_IF; > force_iret(); > } > This would seem to preserve a whole bunch of other flags that should not be leaked between processes, such as DF or TF. -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/