From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752841AbaCJRi6 (ORCPT ); Mon, 10 Mar 2014 13:38:58 -0400 Received: from mga09.intel.com ([134.134.136.24]:65232 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbaCJRi5 (ORCPT ); Mon, 10 Mar 2014 13:38:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,625,1389772800"; d="scan'208";a="469702762" Message-ID: <531DF896.8010305@linux.intel.com> Date: Mon, 10 Mar 2014 10:38:30 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Andy Lutomirski CC: Linus Torvalds , Linux Kernel Mailing List , Stefani Seibold , Andreas Brief , Martin Runge Subject: Re: [x86, vdso] BUG: unable to handle kernel paging request at d34bd000 References: <20140307013833.GD8427@localhost> <1394176888.1018.3.camel@wall-e.seibold.net> <1394229220.20013.13.camel@wall-e.seibold.net> <1394354848.1002.37.camel@wall-e.seibold.net> <531D044C.2090303@linux.intel.com> <531DD35A.5060202@linux.intel.com> <531DF549.2090403@linux.intel.com> In-Reply-To: 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 03/10/2014 10:31 AM, Andy Lutomirski wrote: >> >>> For 64-bit, this is an entirely different story. The vsyscall page is >>> stuck in the fixmap forever, although I want to add a way for >>> userspace to opt out. The vvar page, hpet, etc could move into vmas, >>> though. I kind of want to do that anyway to allow processes to turn >>> off the ability to read the clock. >> >> Wait... you want to do what?! > > This isn't even my idea: > > commit 8fb402bccf203ecca8f9e0202b8fd3c937dece6f > Author: Erik Bosman > Date: Fri Apr 11 18:54:17 2008 +0200 > > generic, x86: add prctl commands PR_GET_TSC and PR_SET_TSC > > This patch adds prctl commands that make it possible > to deny the execution of timestamp counters in userspace. > If this is not implemented on a specific architecture, > prctl will return -EINVAL. > > Currently anything that tries to use the vdso will just crash if you > do that, and it fails to turn off direct HPET access. Fixing this > might be nice, but the current vvar implementation makes it > impossible. If you want to stick something in a seccomp sandbox and > make it very difficult for it to exploit timing side channels, then > this is important :) > Yes, we'd have to switch the vdso to using syscall access. Doing that from inside a system call is... "interesting". -hpa