From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH v4 15/29] x86/mm/64: Enable vmapped stacks Date: Mon, 27 Jun 2016 10:28:12 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-oi0-f48.google.com ([209.85.218.48]:36431 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644AbcF0R2O (ORCPT ); Mon, 27 Jun 2016 13:28:14 -0400 In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andy Lutomirski Cc: Brian Gerst , Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , linux-arch , Borislav Petkov , Nadav Amit , Kees Cook , "kernel-hardening@lists.openwall.com" , Josh Poimboeuf , Jann Horn , Heiko Carstens On Mon, Jun 27, 2016 at 8:54 AM, Andy Lutomirski wrote: > > How about: > > tsk_stack = (unsigned long)task_stack_page(tsk); > if (regs->rsp <= tsk_stack + 7*8 && regs->rsp > tsk_stack - PAGE_SIZE) { I'm not at all convinced that regs->rsp will be all that reliable under a double-fault scenario either. I'd be more inclined to trusr cr2 than the register state. It's true that double faults can happen for *other* reasons entirely, and as such it's not clear that %cr2 is reliable either, but since this is all just about a printout, I'd rather go that way anyway. Linus