Received: by 10.223.176.5 with SMTP id f5csp641176wra; Tue, 30 Jan 2018 17:03:04 -0800 (PST) X-Google-Smtp-Source: AH8x22418QqEXRnjZU9ClRG/f0kVldgx3Dyl3/q4N+hQFDq7opLn5C3Y9LPcLe0Jvj3n5+lcXidz X-Received: by 2002:a17:902:9a97:: with SMTP id w23-v6mr27445367plp.100.1517360584309; Tue, 30 Jan 2018 17:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517360584; cv=none; d=google.com; s=arc-20160816; b=M4oq6EN/04DEv0cL5Ihwj3Ku3K4WAI9igiw3+HRJ38xFyD7SVgdeIdl88cWY4mCWwg VST51puLgM4+8SUJtH9xyeyLcgGtwYMhKtp/chmXWzT9VsW8VC6fojGPznE4ATNYMAq/ 9yWIFLCQ2+STfMs6xSf63PHYQaxYIg6x8KU8zmAeED+wjl84sHxyEBlo3ptH3nOELfaK aYK9eY2HDBKK2WoZ/q5e68tQ7saMIzZVSoI8NoC4nCtZJOkm1L+G0hPu7cuGp/A1Uewn ul0e5xovmVr/LZ9cR8XfLePtrNZx+qzxjvvhXJjMursJG6q5aMIXZxbivQUoSNC9Dh2G XL8A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=GJQPw5id2t1x6rFVZdlFBdSm01d0Mpml/emvgDcqRUI=; b=RUUKw8nOf34yQWUBkTzY0IUvJPyWKwauJ1ia59Qj+K0DRsDe+n4YycA96/pzBvObD7 RHwdnhbL6Xs/lIbV4tNSfivwi0UImoy3ZaY/yDx6q8ftxRA2RsveIl8NkmDVuKPxyikF F4UtlDOR918LOequwpHg6QvbGNZ1c+Ns6m/+OY8Cy5XK21VNy1IpUy7ic71Rt4vg2Int SxrEtBXJsux8+YyemIaOZxcup6OfS6V017DWliIVjCnecyr8jwU4RMsV/1cCwPhGHvZa SIuCyiBtSZNWAnh8qdC+udLI4tUY1IoVBuWCe3Mnqbc2h78l3sc/lyNFnM/j5MUNJkmE kyqg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si2856379plo.702.2018.01.30.17.02.50; Tue, 30 Jan 2018 17:03:04 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754346AbeAaAZ3 (ORCPT + 99 others); Tue, 30 Jan 2018 19:25:29 -0500 Received: from mga02.intel.com ([134.134.136.20]:61848 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753788AbeAaAZ2 (ORCPT ); Tue, 30 Jan 2018 19:25:28 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2018 16:25:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,437,1511856000"; d="scan'208";a="14700467" Received: from schen9-desk3.jf.intel.com (HELO [10.54.74.42]) ([10.54.74.42]) by orsmga006.jf.intel.com with ESMTP; 30 Jan 2018 16:25:27 -0800 Subject: Re: [PATCH] x86/speculation: Use Indirect Branch Prediction Barrier in context switch To: Borislav Petkov Cc: David Woodhouse , arjan@linux.intel.com, tglx@linutronix.de, karahmed@amazon.de, x86@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, pbonzini@redhat.com, ak@linux.intel.com, torvalds@linux-foundation.org, gregkh@linux-foundation.org, mingo@kernel.org, luto@kernel.org, linux@dominikbrodowski.net References: <1517263487-3708-1-git-send-email-dwmw@amazon.co.uk> <20180130203836.bsgme6kf6hstgbrx@pd.tnic> <024dd53b-1912-34fa-deb8-550c111df521@linux.intel.com> <20180130215731.pszc5u4gcc32ds4v@pd.tnic> <296de30b-515b-6eab-1b13-bb2f71451004@linux.intel.com> <20180130224340.2zdfqttupugtqww5@pd.tnic> From: Tim Chen Message-ID: <74fd9c82-cd18-562b-8df6-69f629da460b@linux.intel.com> Date: Tue, 30 Jan 2018 16:25:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20180130224340.2zdfqttupugtqww5@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/30/2018 02:43 PM, Borislav Petkov wrote: > On Tue, Jan 30, 2018 at 02:26:53PM -0800, Tim Chen wrote: >> If the process has multiple threads running on different cpus, > > I'm talking about issuing the barrier in set_dumpable(). What threads on > multiple CPUs? > As dumpable is a property in mm->flags, it affects all threads running on other cpus sharing the same mm. If you issue IBPB only on the cpu that perform the set_dumpable(), the theoretical hole you are trying to close still exist on threads running on other cpu. time -----> (cpu A) set_dumpable victim (thread1), issue IBPB (cpu B) attacker -> victim (thread2), missed IBPB -> attacker -> victim (IBPB issued) That said, I think the risk is minuscule and is not worth the cost to set IBPB on the other cpus. Tim