From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2260pY0ehKW8tAHRJZplGZBqEe6H7HN5LNXi/WEh8WjGNKBBXNDvgVyb66Ake/aKT9wm9XUe ARC-Seal: i=1; a=rsa-sha256; t=1516563460; cv=none; d=google.com; s=arc-20160816; b=W/KgJbHoGJVcrCvxrm+6EkCp/nm366VEFGvfwQ0c4J/mRY/JV4NbNBTfSerFGZ37z0 BbxfAujeTper8pD9xhq6ms60K5jOAxqvuYV/JosAMiILpUpFLMTPCCy1+zKc8SB8PQLU HN3h0LF3bM4qVms3bTeWw+50UCyWgfLoksZjfXdCThlznyQ4t626BOrCIYnAr6Ss8Yia 20Ol4ToXs6oC3MQO31bF59f8mzLQS8mhMFUtNjaMGHcBBtkPgeOB3opBqz36sBTR4Bi1 32jWiu5Qb/U6Ji+lJ+FJK5AUidnglKscY+F5s9BUfDl8E9Vr8ImMU/S5r1zxIMIkZHUv W4dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :arc-authentication-results; bh=eYZmp4nr84/smpKgU7gkDlRUAqPT9CN4hx2QMstYQjs=; b=Q4Lba5tTlA6enVNDgazJFyplZJF1EfyEhFjVhGFCLMHL8vk+hmcNUnGOZiV5FcRI7N U6V6bYKTNEtl30gqi06XBx/qvF+yynoXIfDP/W+57ntPrtZNcj25Et+hnp5ZekDYFmcV 0X6qo/S6Jp3TanYojJcyclu87dy96tvZatPKT1BK91vxuilUigSdJ7Vvn1lMUPcviu9l L9nmIArfo5+nkKLlExOoA/qQTdUBaVMq3deyE94KUUrhjKTIjpM/j2LizwBzOhcGvl98 VkjrlxLf0Gk/KBomnCk4QFvXLJhGLpuaMWe/52hKTIUEofTzEQfCnlBr/m35+h8qzToI parA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of prvs=552f9dda3=andrew.cooper3@citrix.com designates 185.25.65.24 as permitted sender) smtp.mailfrom=prvs=552f9dda3=Andrew.Cooper3@citrix.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of prvs=552f9dda3=andrew.cooper3@citrix.com designates 185.25.65.24 as permitted sender) smtp.mailfrom=prvs=552f9dda3=Andrew.Cooper3@citrix.com X-IronPort-AV: E=Sophos;i="5.46,393,1511827200"; d="scan'208";a="66416615" Subject: Re: [PATCH v2 5/8] x86/speculation: Add basic support for IBPB To: David Woodhouse , Borislav Petkov , KarimAllah Ahmed CC: , , , , , , , , , , References: <1516528149-9370-1-git-send-email-dwmw@amazon.co.uk> <1516528149-9370-6-git-send-email-dwmw@amazon.co.uk> <20180121180621.ufmc5m7nr6v4tjvc@pd.tnic> <31c52131-5f7a-8af0-3092-5fc9e322a734@amazon.com> <20180121190145.uuk3xizxejckth5s@pd.tnic> <1516563060.9814.52.camel@infradead.org> From: Andrew Cooper Message-ID: Date: Sun, 21 Jan 2018 19:37:14 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1516563060.9814.52.camel@infradead.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590195048808685762?= X-GMAIL-MSGID: =?utf-8?q?1590232046802408496?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On 21/01/18 19:31, David Woodhouse wrote: > On Sun, 2018-01-21 at 20:01 +0100, Borislav Petkov wrote: >> so execution runs directly into the MSR write and the JMP is gone. >> >> So I don't see indirect branches anywhere... > Wait until the wind changes. > > Congratulations, you've just turned a potential GCC missed optimisation > into a kernel bug. We don't *care* that it's unlikely that GCC will > miss that optimisation. The point is that it doesn't *have* to do it, > and we don't *check*. > > cf. https://lkml.org/lkml/2018/1/12/176 > > > ... after which Peter went off and implemented that check, which is all > fine and dandy but let's not rely on backporting that too. It doesn't matter if an attacker can use SP1 to try and skip the IBPB. Exits to userspace/guest are serialising (with some retroactive updates to the architecture spec coming), so an attacker can't cause victim code to be executed before speculation has caught up and noticed that the IBPB did need to happen. ~Andrew