Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2671679imu; Sun, 9 Dec 2018 06:54:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/UJHe3jJvgJkcz39Mz4WMJv2mCSTSJIfE0thGrCj8quuH96NgpjC6hAq11eT5CTLDc0St6D X-Received: by 2002:a17:902:5ac2:: with SMTP id g2mr8850667plm.313.1544367257799; Sun, 09 Dec 2018 06:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544367257; cv=none; d=google.com; s=arc-20160816; b=k7JBbnFzbI7Y38a7VqijNzN2xZHVqymm5SPr+3q2dvU4fPbFtbPPJgQ5AzURJk5EPS 1Exw/lGkzOLdK/E+figHEayE1pN/DTxhO1IPBzZsrawyMqRRMKw5dE3mXkk7y3+sRH0K n/l2OXVhLvU0UDtTGE1t2Q/uL4tDICEWPLYRFhC0PfmB47OkCW7QIvzZm5A1B/rzZY/p xrYTVsDpSRxbKbCEfJWkaR3GKYfH6bfg0ZrYxAI7Q60swGKrAvT0W3iORw0lM6fjDVBK byEKNEGTyFLw4GP0YeDF00xnAz7O/vdCz0KSQCxqIjq97KEhQfN5DMTnMaHpnBhTNIHj tiJA== 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:openpgp:from:references:cc:to:subject:dkim-signature; bh=l0srbhcHbgQlVQPBg/OmvSTJKddNhV75fpIIOgujBA0=; b=HyrOqffjG5lvQYG5aFT507wK/Vv5NfvwB4u8w6/3+kKUkqedZXZFl2z8JWuaGZ1WtU 1ORcs5ZbR86tVXR+H3iDwlpkZTInxSS3L7zDrJ8Vk8a8HyEoZUAUFoHngq9tCXIx2Evy bjAigGLw/kKktwG0Qtwak9J1BhbmQu/nHiFoVptgoI5+IxtUDlzRhS4VF5cmzdjFDTPn K9H0FtywAKV4DoT/F3On6zI1Y48ACBfrKxTmzu6jlHCS6iZavlrgBo8h4L54tcfhhi6U opf1lY36Kmxamt/uyUw6Ybb7vDx1epFqDJnDe2Rv1QTFyYxh1MjZjyPa0LGAJIlSSmlp Mx/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CvaoG/fm"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h96si8445585plb.230.2018.12.09.06.54.00; Sun, 09 Dec 2018 06:54:17 -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=@linaro.org header.s=google header.b="CvaoG/fm"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726266AbeLIOxZ (ORCPT + 99 others); Sun, 9 Dec 2018 09:53:25 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:36610 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbeLIOxZ (ORCPT ); Sun, 9 Dec 2018 09:53:25 -0500 Received: by mail-oi1-f196.google.com with SMTP id x23so7052304oix.3 for ; Sun, 09 Dec 2018 06:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=l0srbhcHbgQlVQPBg/OmvSTJKddNhV75fpIIOgujBA0=; b=CvaoG/fmDfncOFK6yG+4XoSdBzrF6mDuqA1riqO40E1LOhXjNhgw/07jpMbkAK/lf5 2iiQf3q0zQZ6soCrWxBk02Kv6fQqutTGgNYFlo39WgmjvLnRnqJjDDSLcyXY4LfdqQne rCdFOyMj/00B+R1+9O4E3WtTNxM7QiS06iNvM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=l0srbhcHbgQlVQPBg/OmvSTJKddNhV75fpIIOgujBA0=; b=irUiF4lpVv6Bz5oO80zU7Lz4Z9T1gAyb0VuCg/o7689WK1S441hz7aXY3Y6WaLKbw8 IjKklWpeqqsFg/AUq5vD/Y2+wKcvroQgqn6qv5cdAnKKiBXynzTbp4SFr2kiBrSd95fF qTqxpePb4nuKODguT0qbfxncbdUTuCjYBuH64gm4yeQi0DaBqcUgiQnKoz5LBUUcPW4Z 7mn/C+KvNk1GA52hqc3fiwWok91RL928kNBd/Khwc9arySOlyV8EDAYQTDm5AIqaK8i9 ASdVW96ftqYmAiL0FdGOIuCecInSfGbZhfqFOX1H6Md3Nwe+byNUjj3zmoBByfLYYr/n bvcA== X-Gm-Message-State: AA+aEWbnWOVousB0O3c6OKymwRtm9ClcEVTPV6kuPAvLg7Yh9e4/x65k zkQ5VKp29UH+qLTLUXE59sqPwcF/KOVPhg== X-Received: by 2002:aca:915:: with SMTP id 21mr5566298oij.163.1544367203794; Sun, 09 Dec 2018 06:53:23 -0800 (PST) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id e8sm3987807otq.17.2018.12.09.06.53.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 06:53:23 -0800 (PST) Subject: Re: [PATCH v6 04/13] arm64/kvm: hide ptrauth from guests To: Kristina Martsenko , linux-arm-kernel@lists.infradead.org Cc: Adam Wallis , Amit Kachhap , Andrew Jones , Ard Biesheuvel , Catalin Marinas , Christoffer Dall , Cyrill Gorcunov , Dave P Martin , Jacob Bramley , Kees Cook , Marc Zyngier , Mark Rutland , Ramana Radhakrishnan , Suzuki K Poulose , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org References: <20181207183931.4285-1-kristina.martsenko@arm.com> <20181207183931.4285-5-kristina.martsenko@arm.com> From: Richard Henderson Openpgp: preference=signencrypt Message-ID: <57966497-d21c-5439-e4ba-d75f5552282f@linaro.org> Date: Sun, 9 Dec 2018 08:53:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181207183931.4285-5-kristina.martsenko@arm.com> 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 12/7/18 12:39 PM, Kristina Martsenko wrote: > From: Mark Rutland > > In subsequent patches we're going to expose ptrauth to the host kernel > and userspace, but things are a bit trickier for guest kernels. For the > time being, let's hide ptrauth from KVM guests. > > Regardless of how well-behaved the guest kernel is, guest userspace > could attempt to use ptrauth instructions, triggering a trap to EL2, > resulting in noise from kvm_handle_unknown_ec(). So let's write up a > handler for the PAC trap, which silently injects an UNDEF into the > guest, as if the feature were really missing. Reviewing the long thread that accompanied v5, I thought we were *not* going to trap PAuth instructions from the guest. In particular, the OS distribution may legitimately be built to include hint-space nops. This includes XPACLRI, which is used by the C++ exception unwinder and not controlled by SCTLR_EL1.EnI{A,B}. It seems like the header comment here, and > +/* > + * Guest usage of a ptrauth instruction (which the guest EL1 did not turn into > + * a NOP). > + */ > +static int kvm_handle_ptrauth(struct kvm_vcpu *vcpu, struct kvm_run *run) > + here, need updating. r~