Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp600177ybi; Fri, 7 Jun 2019 13:24:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPTK62QJjsJCWjEy49I7ogCYIx1hkc3c1/tUlmZYEiYVRVdqsyXDvwx8Kfz+n/GkjkXf68 X-Received: by 2002:a17:90a:d34f:: with SMTP id i15mr7841382pjx.1.1559939079959; Fri, 07 Jun 2019 13:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559939079; cv=none; d=google.com; s=arc-20160816; b=oUPPLUwbX5CKnAW7GlnzisCnto5sMZYdKKebfRywOeAiQGpi9/FOwKtnbkSPVZAxnh tXyvCXldDbxLgTpjlSIQ4ZvTBLMcetT10gjqcir/jR76hMhhpBlgiY/etcVdHRPGUuZR hg/hcmAy6ZQR5CYan5BgpHwNC5AiPy9PfPoa0f1RhCCG+fsjLQW99TkO/YWhEIETr2z4 L047x7k2XyYtJpA8aNqA1hezsHykWekvsKTAxGqkq5ppoct4+8uAInhYwV6gJ3xwYcuz 1B+CroYxK+OpAVv5HLFKadcp4LZaPscjvHedV9k7ff2QW0VlMJhQQAwLceBDFmVPnJsc 8dHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=iJZHaE5MiCsrO1KQclInA0tIHjE0U6f5yWLWeAuFbjM=; b=fXdJBxdydr3ThZFQUrWHGaRkMSMSmD/h/GxddFAov+ja7/fBUip9PcvLzFrSLz7ZQG wP/vVS/ayeT+vokxW71Lbj/4iOBAC17KztLOi54UUbUlSkdGo/Zv98VqfpJN3Ck6mpwj W+fHmXYmkSOhCZQwpCw7MS+JR89ICVQgPVk4+VDJJyDBZt7cWwitJr/NvYEHJcHXD5m/ E5OjQEDMgSLlmrlPNwD+YHi6qbepFny54FybwvYxWo0Tz1VB6T5nA60Yb3kWbRAjAAqq lC6qJWT/lo2Cot5vh00d09/Zw8Tdtcpkn+cQUxiWzBgpEDgPis+JkEs0G3V8calmdCu6 J9Lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si2830179pgu.457.2019.06.07.13.24.23; Fri, 07 Jun 2019 13:24:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729990AbfFGUEn (ORCPT + 99 others); Fri, 7 Jun 2019 16:04:43 -0400 Received: from mga07.intel.com ([134.134.136.100]:16835 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729342AbfFGUEn (ORCPT ); Fri, 7 Jun 2019 16:04:43 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2019 13:04:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,564,1557212400"; d="scan'208";a="182781141" Received: from yyu32-desk1.sc.intel.com ([143.183.136.147]) by fmsmga002.fm.intel.com with ESMTP; 07 Jun 2019 13:04:42 -0700 Message-ID: <9d3cedc83c236ee7a109325113fd1c1f9d849f25.camel@intel.com> Subject: Re: [PATCH v7 03/14] x86/cet/ibt: Add IBT legacy code bitmap setup function From: Yu-cheng Yu To: Dave Hansen , Andy Lutomirski Cc: Peter Zijlstra , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Date: Fri, 07 Jun 2019 12:56:40 -0700 In-Reply-To: <352e6172-938d-f8e4-c195-9fd1b881bdee@intel.com> References: <20190606200926.4029-1-yu-cheng.yu@intel.com> <20190606200926.4029-4-yu-cheng.yu@intel.com> <20190607080832.GT3419@hirez.programming.kicks-ass.net> <20190607174336.GM3436@hirez.programming.kicks-ass.net> <34E0D316-552A-401C-ABAA-5584B5BC98C5@amacapital.net> <352e6172-938d-f8e4-c195-9fd1b881bdee@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-06-07 at 11:58 -0700, Dave Hansen wrote: > On 6/7/19 11:29 AM, Andy Lutomirski wrote: > ... > > > I think this new MSR probably needs to get included in oops output when > > > CET is enabled. > > > > This shouldn’t be able to OOPS because it only happens at CPL 3, > > right? We should put it into core dumps, though. > > Good point. > > Yu-cheng, can you just confirm that the bitmap can't be referenced in > ring-0, no matter what? We should also make sure that no funny business > happens if we put an address in the bitmap that faults, or is > non-canonical. Do we have any self-tests for that? Yes, the bitmap is user memory, but the kernel can still get to it (e.g. copy_from_user()). We can do more check on the address. > > Let's say userspace gets a fault on this. Do they have the > introspection capability to figure out why they faulted, say in their > signal handler? The bitmap address is kept by the application; the kernel won't provide it again to user-space. In the signal handler, the app can find out from its own record. [...]