Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751916AbaDYVUe (ORCPT ); Fri, 25 Apr 2014 17:20:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:25937 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156AbaDYVUc (ORCPT ); Fri, 25 Apr 2014 17:20:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,929,1389772800"; d="scan'208";a="528567749" Message-ID: <535AD19D.8000502@linux.intel.com> Date: Fri, 25 Apr 2014 14:20:29 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Pavel Machek CC: Linux Kernel Mailing List , "H. Peter Anvin" , Linus Torvalds , Ingo Molnar , Alexander van Heukelum , Andy Lutomirski , Konrad Rzeszutek Wilk , Boris Ostrovsky , Borislav Petkov , Arjan van de Ven , Brian Gerst , Alexandre Julliard , Andi Kleen , Thomas Gleixner Subject: Re: [PATCH] x86-64: espfix for 64-bit mode *PROTOTYPE* References: <1398120472-6190-1-git-send-email-hpa@linux.intel.com> <20140425120229.GA4691@amd.pavel.ucw.cz> In-Reply-To: <20140425120229.GA4691@amd.pavel.ucw.cz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/25/2014 05:02 AM, Pavel Machek wrote: > > Just to understand the consequences -- we leak 16 bit of kernel data > to the userspace, right? Because it is %esp, we know that we leak > stack address, which is not too sensitive, but will make kernel > address randomization less useful...? > It is rather sensitive, in fact. >> The 64-bit implementation works like this: >> >> Set up a ministack for each CPU, which is then mapped 65536 times >> using the page tables. This implementation uses the second-to-last >> PGD slot for this; with a 64-byte espfix stack this is sufficient for >> 2^18 CPUs (currently we support a max of 2^13 CPUs.) > > 16-bit stack segments on 64-bit machine. Who still uses it? Dosemu? > Wine? Would the solution be to disallow that? Welcome to the show. We do, in fact disallow it now in the 3.15-rc series. The Wine guys are complaining. -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/