Received: by 10.223.176.46 with SMTP id f43csp130351wra; Thu, 25 Jan 2018 18:52:10 -0800 (PST) X-Google-Smtp-Source: AH8x2249lpRxItvID44lGRZQIuRtqTlsrmufCryfoqRTzyMrYYoHIruwBOPXVjsEijCum2RC0Ec7 X-Received: by 2002:a17:902:6908:: with SMTP id j8-v6mr12981051plk.211.1516935130339; Thu, 25 Jan 2018 18:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516935130; cv=none; d=google.com; s=arc-20160816; b=SW3AEjjc9unTWoEQYf5SXiSn+tWp0eE9TilyPo88+o8jmycp8BfCzpBhdHkxkLxGIZ FhbiSilHqD18fXESNZfwKAjUO5KpHvChIQPi5/NhddRwYRajNW8FvVFGZ3/SCmZVPchr TURsHceB5kK1dUHz7LywGFjVuZeKsKc5TrP59ZxMt/aQDMqn98er6yRe0ie/sWodcRtU QPBA2wRxGP5UhIxJZuNhCKzqp7HOf1y0n4cHPKUoflFYDQ2AsOG9KPuk+U6m0NE2L67S Iu2jconcdwcq0dRVc5RfbfhYXwOeXWQNRvxVgIIXV99M7yVgV5qwX2WE4zP8u6egIVLv /oJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:subject:cc:to:from:date:message-id :mime-version:dkim-signature:arc-authentication-results; bh=5wpfo2Qzm+4+9SDX6w6rFw/1sYRzaq0nJVu14ANZO1g=; b=x0wY8J26dryLRLDkleYISrzQ5GTGnIUhoTFgaLE0k+bHJlYUekQyAREYgM6uxfEW2T JHsDTx1zfpZ79Gy+XQKVCnCudvRYblNGv6PKfCmKqmZl/axAyhPvL+glGKHfH8Eoz3WF eVn6FL8Okr6YTno+Uwtb26XjnWYKpr/Pv1I31FSgjlErrQUq0QlBJcMC3enKH+N0wATp sOBm6G1lmY+ThxCLXwQS++t/xggLKK8TdxO7s3fHjU9q3KV++TqN8kNG0aEgddIvyYxc AMSd4m9v/TJj30CNIiV6GG0hFOV1b0GqFoVTa1hhNYZ8skFZ6Nug5NxBToP9GVVQhWjs pqEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=BqMpp/YX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v67si5577324pfj.193.2018.01.25.18.51.56; Thu, 25 Jan 2018 18:52:10 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=BqMpp/YX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640AbeAZCvd (ORCPT + 99 others); Thu, 25 Jan 2018 21:51:33 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:48248 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751466AbeAZCvb (ORCPT ); Thu, 25 Jan 2018 21:51:31 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0Q2lje2133543; Fri, 26 Jan 2018 02:50:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : to : cc : subject : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=5wpfo2Qzm+4+9SDX6w6rFw/1sYRzaq0nJVu14ANZO1g=; b=BqMpp/YXjihuPz6udHAbQs8CclUUVAzXT9ziGnecWLbuh3dnCDvnMt/wZY233DcWYlJx //1PrR8ioMefP+rohtTwvrz5IizreOLORgZheuQMYmdhTBgqZs3Guya4oB1IwjjsoOat 6eJ919qkWUDcRrhZwxbZyQ7FhWORh4W+ENIFiKrQP6nrLjXqrkcs5ox+m5fBgCZPplwm /IUGjSIjuxDgXhsSHTPGdgfADmSXCN/tA0lhkCWDYWr2gEvzVKLG6zfWOJekWX0/tjth BVgLUYMXCrihGZEjpA4IRWnl7QbVh75QKWRIKb/UYS5jhTRz2orJTVZavyfa+0pw39S0 og== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2fqutj80ac-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jan 2018 02:50:30 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0Q2oTZp032561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jan 2018 02:50:29 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0Q2oR3A026775; Fri, 26 Jan 2018 02:50:27 GMT MIME-Version: 1.0 Message-ID: <23aae227-461c-4d0d-8ccb-df01bae98b2e@default> Date: Thu, 25 Jan 2018 18:50:27 -0800 (PST) From: Liran Alon To: Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [RFC 09/10] x86/enter: Create macros to restrict/unrestrict Indirect Branch Speculation X-Mailer: Zimbra on Oracle Beehive Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8785 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=1 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=1 mlxscore=1 mlxlogscore=217 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801260034 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- dave.hansen@intel.com wrote: > On 01/25/2018 06:11 PM, Liran Alon wrote: > > It is true that attacker cannot speculate to a kernel-address, but > it > > doesn't mean it cannot use the leaked kernel-address together with > > another unrelated vulnerability to build a reliable exploit. >=20 > The address doesn't leak if you can't execute there. It's the same > reason that we don't worry about speculation to user addresses from > the > kernel when SMEP is in play. Maybe I misunderstand BTB & BHB internals. Will be glad if you could pinpoi= nt my error. Google P0 blog-post (https://googleprojectzero.blogspot.co.il/2018/01/readi= ng-privileged-memory-with-side.html) claims that BTB & BHB only use <31 low= bits of the address of the source instruction to lookup into the BTB. In a= ddition, it claims that the higher bits of the predicated destination chang= e together with the higher bits of the source instruction. Therefore, it should be possible to leak the low bits of high predicition-m= ode code BTB/BHB entries from low prediction-mode code. Because the predict= ed destination address will reside in user-space. What am I missing? Thanks, -Liran