Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674AbbGBP4j (ORCPT ); Thu, 2 Jul 2015 11:56:39 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:36104 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753231AbbGBP4c (ORCPT ); Thu, 2 Jul 2015 11:56:32 -0400 MIME-Version: 1.0 In-Reply-To: <20150702104956.GF4001@pd.tnic> References: <2dd2507c09d813cea63b7d93b66956d36de5402f.1435602481.git.luto@kernel.org> <20150702104956.GF4001@pd.tnic> From: Andy Lutomirski Date: Thu, 2 Jul 2015 08:56:11 -0700 Message-ID: Subject: Re: [PATCH v4 11/17] x86/entry/64: Migrate 64-bit and compat syscalls to new exit hooks To: Borislav Petkov Cc: Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Rik van Riel , Oleg Nesterov , Denys Vlasenko , Kees Cook , Brian Gerst , Paul McKenney Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2057 Lines: 49 On Thu, Jul 2, 2015 at 3:49 AM, Borislav Petkov wrote: > On Mon, Jun 29, 2015 at 12:33:43PM -0700, Andy Lutomirski wrote: >> These need to be migrated together, as the compat case used to jump >> into the middle of the 64-bit exit code. >> >> diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S >> index efe0b1e499fa..ac0658142ae1 100644 >> --- a/arch/x86/entry/entry_64_compat.S >> +++ b/arch/x86/entry/entry_64_compat.S >> @@ -209,10 +209,10 @@ sysexit_from_sys_call: >> .endm >> >> .macro auditsys_exit exit >> - testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT), ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) >> - jnz ia32_ret_from_sys_call >> TRACE_IRQS_ON >> ENABLE_INTERRUPTS(CLBR_NONE) >> + testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT), ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) >> + jnz ia32_ret_from_sys_call > > I guess you want to use tabs here like the rest of the macro does. > Oops. I wrote this before everything got tabified and I guess I didn't fix it up right. >> movl %eax, %esi /* second arg, syscall return value */ >> cmpl $-MAX_ERRNO, %eax /* is it an error ? */ >> jbe 1f >> @@ -227,11 +227,10 @@ sysexit_from_sys_call: >> testl %edi, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) >> jz \exit >> xorl %eax, %eax /* Do not leak kernel information */ >> - movq %rax, R11(%rsp) > > I guess that change needs at least some explanation in the commit > message. AFAIU, this is RIP we shouldn't be zeroing for we need it in > int_ret_from_sys_call... This change is a mistake. There was another rebase issue in here that I fixed, but apparently I still haven't gotten it right. Sigh. --Andy -- 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/