Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752898AbbDFXAr (ORCPT ); Mon, 6 Apr 2015 19:00:47 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:34995 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751130AbbDFXAo (ORCPT ); Mon, 6 Apr 2015 19:00:44 -0400 MIME-Version: 1.0 In-Reply-To: <1428173719-7637-1-git-send-email-dvlasenk@redhat.com> References: <1428173719-7637-1-git-send-email-dvlasenk@redhat.com> Date: Mon, 6 Apr 2015 19:00:43 -0400 Message-ID: Subject: Re: [PATCH] x86: clear EXTRA_REGS for all executable formats From: Brian Gerst To: Denys Vlasenko Cc: Ingo Molnar , Linus Torvalds , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , "the arch/x86 maintainers" , Linux Kernel Mailing List 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: 1076 Lines: 26 On Sat, Apr 4, 2015 at 2:55 PM, Denys Vlasenko wrote: > On failure, sys_execve does not clobber EXTRA_REGS, so we can just > return to userpsace without saving/restoring them. > > On success, ELF_PLAT_INIT in sys_execve clears all these registers. > > On other executable formats: > binfmt_flat.c has similar FLAT_PLAT_INIT, but x86 (and everyone else > except sh) doesn't define it. > binfmt_elf_fdpic.c has ELF_FDPIC_PLAT_INIT, but x86 (and most others) > doesn't define it. > There are no such hooks in binfmt_aout.c et al. We inherit > EXTRA_REGS from the prior executable. None of these are supported on x86-64. The first two are for embedded MMU-less systems. a.out is only supported for a few old arches (x86-32, alpha, m68k). ia32_aout.c does explicitly clear the extra registers. -- Brian Gerst -- 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/