From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x22750kc4tToYHbdIqEzThFUFDHcF10EftcQiEr39OELN+zjA703Gce38x0c/wjKAXLyHiT6h ARC-Seal: i=1; a=rsa-sha256; t=1517358328; cv=none; d=google.com; s=arc-20160816; b=ZVRBrzZP8jrod1Ne7l7bnbw9mcRTMpkGU/JysAhT/RILL3ibjSWkxph2vjDjzMtL63 7RTsRvw4ObqgZ8YwMlBSkbx7tCwbeengRynH3yaCWB60BXVLlGU9L5kqhyAThWMNrlOy 89LxrsjwAJzNzIEKAhGZEg7dG5hirBc0jO6/2FHew7rEPixZHYZ8RLA0LoUGt0hWHRQF c4CkZ6IROpq4npbF0lL28TbkFjeQyjSH9ngAeykQQe/7FSC4aaVdUHs/asGeOf042jQ0 MdHho0YOMptqRHl/WqBElDZjo1W4CB4NiE314KpsGr0Kj7BQFKuIQjTfTLZlgmsalZPV 7rvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=VdVLtfiKdwxkto5+uRALEJdOS5z8wEwt6FaPQVnmbgufo3s8uuTiWp1CAhndndBpJm VHbTwuY5o5j+4ods7slrWCg4d4NwjmwQolHJV+oMYhrYlh8DuTtir47+puEK2ssJ14UZ F4igOuW8Oi9wnqT8coH0F6Nj5fLlyTm1VfAZGibOrLB8IsyJldzRMPnAebJ3opWHKu3N KTojsd4eA6vNdnFfGydclk3KlyZKdTLT57iR1AQlmwB5Bn0xrC3rN53WNhrxa3hoGR0q GTnuqoDYuLrIpRvZ95erJzNjIr1lBmH7pHF9G0pkhSk1hKFh+CFdkDUcV8Tfcfg48jc/ OW4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of tim.c.chen@linux.intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=tim.c.chen@linux.intel.com Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of tim.c.chen@linux.intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=tim.c.chen@linux.intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,437,1511856000"; d="scan'208";a="14700467" 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590966106432961445?= X-GMAIL-MSGID: =?utf-8?q?1591065525947500412?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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