Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp351109yba; Fri, 26 Apr 2019 00:52:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJzZSkdOQA5bAow2/NzC1+Z/Soyiwn5mb1oTgDNZAnx7TJyc7JoJjQBtFcrSUzPWKckagq X-Received: by 2002:a65:6108:: with SMTP id z8mr42024413pgu.106.1556265140816; Fri, 26 Apr 2019 00:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556265140; cv=none; d=google.com; s=arc-20160816; b=ZGW9NmwIqsV0AyAJFH/Xs5x61+DVkcFAM4V7cL9sm/8pWW1OGeca5WTVWS9YWnBP5k 6SVgVcpYa8eTkwXXpHB2bN1s9DOW00z4Re9i1uHFUldU4qrZgEOVkti727hlnanXcazk ZoGJnNRQxWfQCY3UiPzPrQH3dBRRKsdWA3JwzKVN6n7YbpWp9XiPMAFRhMyIX32TqrgA G7X0ikiRcs3WjpYjGrDHRtLafkLOB3JgDMTpa/tU133vfCiQo+0muXUza0r1T8b/33sR /aBqMjzWr8ajXec+2AGbapjRHAXfU5CpKJStbHiRAdQG9T6Dwyry4l7mRbMI2zIUxnob UMxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=slE4aT5ZNj8dJtxH+FhGBwyu8kafNxlAmX6nDldrcS4=; b=Tl8H94MJaBl4ViZ206PkXCeeMd7yV+ScqUQmIwjXnI/O7HVqf1ZIofR7BWgqpyFQfl i1Cw6lJEcaFeDUWhR5z/ZPA3Oiqq5Xlp//YRSWqOGGNe9nith/hCCgvJRxucYogVOIop j+d3YdiJNW6hrsxqGZ9hBfcLsuyY2RceiJwBv4vIMWzRuz0dvHz/uscwSbcTwFJzlCp+ fcDFe2rVt3k1vQZzd0bxp9H4hcB45t5fOGdNuPJ4HWfj1137iduUmVtMNTHhqJIgqswv G5kj14Jc9LgNXcWI+Y/I7YueaGZK5LboOhSHT2eCKbymIs1b3uHYwQ3XUVm9ELR/Gdbt VLfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Op/BtNTT"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si22602679pgs.33.2019.04.26.00.52.06; Fri, 26 Apr 2019 00:52:20 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Op/BtNTT"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726074AbfDZHuF (ORCPT + 99 others); Fri, 26 Apr 2019 03:50:05 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54664 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbfDZHuF (ORCPT ); Fri, 26 Apr 2019 03:50:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=slE4aT5ZNj8dJtxH+FhGBwyu8kafNxlAmX6nDldrcS4=; b=Op/BtNTTdoi+lOukFcWX4choG 882I7O1OKUeSfugw5FDEE8frhdfBaCMcWl7hiSMX4nAWztIGM/B8ibBqKFJCnPoXp3/kDy8rx4YhC uvUqRvrvrWFh2fq+KduiKrBv0H3yBWK9oBjFXVmqQdGZjrNASCAJ2og1IxUQGRcYMRhDFVfDSZfT+ 4VC6UmQw9hJk/NJjOjl6W/Xu0rWytUIlcVnGCFV7+DZT3hSVyFwowHpwdkK1vdxZB0t5myzQODMOg 8HwgOCiydPFYEFjDX9PDp1qRkAhAtoU1oxTNk4Jif8MITPXfuFbirlP9K0Wd7JE+ALAjgNBoFEtto wg1bodvqA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJvcM-0000zs-Bl; Fri, 26 Apr 2019 07:49:58 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B4A6F29D1A323; Fri, 26 Apr 2019 09:49:56 +0200 (CEST) Date: Fri, 26 Apr 2019 09:49:56 +0200 From: Peter Zijlstra To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Alexandre Chartre , Andy Lutomirski , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , James Bottomley , Jonathan Adams , Kees Cook , Paul Turner , Thomas Gleixner , linux-mm@kvack.org, linux-security-module@vger.kernel.org, x86@kernel.org Subject: Re: [RFC PATCH 2/7] x86/sci: add core implementation for system call isolation Message-ID: <20190426074956.GZ4038@hirez.programming.kicks-ass.net> References: <1556228754-12996-1-git-send-email-rppt@linux.ibm.com> <1556228754-12996-3-git-send-email-rppt@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1556228754-12996-3-git-send-email-rppt@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 12:45:49AM +0300, Mike Rapoport wrote: > The initial SCI implementation allows access to any kernel data, but it > limits access to the code in the following way: > * calls and jumps to known code symbols without offset are allowed > * calls and jumps into a known symbol with offset are allowed only if that > symbol was already accessed and the offset is in the next page > * all other code access are blocked So if you have a large function and an in-function jump skips a page you're toast. Why not employ the instruction decoder we have and unconditionally allow all direct JMP/CALL but verify indirect JMP/CALL and RET ? Anyway, I'm fearing the overhead of this one, this cannot be fast.