From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DC78C48BDF for ; Thu, 24 Jun 2021 06:59:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFD6D61374 for ; Thu, 24 Jun 2021 06:59:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFD6D61374 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=icaReu2Dlekp6/v+WT798SDCCU9rXMnGyHU8gRpROGw=; b=jjcLad1SFFr/FRHdilJ2KVtXs/ bGxz7es/panTOTxEVODWecWu/udM/vjGWsOmAPFuRAxyOWFn2181HuguCRifLfPY/cqU7tctjyKj4 KBUhoFRdc2RDR59RSah/drCt4PbBmVw6WyVDEt32AJIZ6B2fP9n4katPBvYJM6izR08oaxFT83KSv IN8hFU52HTadrPhSN9WrQAGTb7SZi79xt0VBMHjsFki2qO5vXlyXMs/E5P5O51DrVFsHATGBCWOCT JkhsIil7VUGSJWZghbz6hu7ENYYqm4liA1B4xI5yLmA3ushnkSgNjhPMkFFbcYnTjvTuKHRtBOuQY xAnHCVpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwJJ7-00D4Xa-DE; Thu, 24 Jun 2021 06:57:49 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwJJ3-00D4W4-NR for linux-arm-kernel@lists.infradead.org; Thu, 24 Jun 2021 06:57:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624517863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=igFDOV6BxGJ7IfsozRxLlI1SBnI7ilQNQtLZk9DKzFQ=; b=NfMKvr8Ax1E1LpAoe9jSBidAQj+ol3buwQmpYHGZG+kDQY+eCVgPPndbFH8AmRYtuUGdd6 73Dbvk1gl3N6WMgE0j2Ge8KPXEThGtYmYzN2ufR5BXrPwwfcYj9hfimVKweuRvymgVyEEw vdbW6duZZOGeWQm/vjJkitKFrUcOawo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-183-eMYAy8WdNTO-jWE7lsHAjQ-1; Thu, 24 Jun 2021 02:57:41 -0400 X-MC-Unique: eMYAy8WdNTO-jWE7lsHAjQ-1 Received: by mail-wr1-f71.google.com with SMTP id p2-20020a5d63820000b029011a9ecaf55dso1799462wru.19 for ; Wed, 23 Jun 2021 23:57:41 -0700 (PDT) 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=igFDOV6BxGJ7IfsozRxLlI1SBnI7ilQNQtLZk9DKzFQ=; b=O3986fz2phWEXwunFo80dzUMW0Qc6QYK+PAUxRjIFHSt1ynVQ8MAOFcw2mLRiFKrny GEa6rH18S6eG67QbX+MqjNMW8LyeDA5neUW7hWm9qVGKo3lpgIdiwEVL4DEAofOSfeSx rmYbPocvA5Q+9CAGiqdeVL/7msmYakdXE+szk5db07cxGp93l32YUxhIJyT98YaQqVxd Zvtd3+kfubfOOK0OwWVgTBo7TgFFkSqKE4YfaaExbSL3G81+VseTMo1L+vFHVVXZ5IkO PoDDJbSm1dJcAe+uzQHfzi8amwJp6sRNPbEaJCFgiU4Q1YyTvEjL3h/QkmT2h02adThZ V21A== X-Gm-Message-State: AOAM532M3ib49QFwPLiR3HfrmzZvzvwLgNXVEzTj+kBjWDryRchjLiaj E9mBlYwVnE/apAoB6q1c2KSteAMmZyD79/T7JNlg/PIW3aLtijjIb1sqr9Xvgl4jaXaDdpL0i9R pe1SvpGJeoxwUaPvKHcCooIkf2DOnL7hoYUA= X-Received: by 2002:a05:6000:1889:: with SMTP id a9mr85613wri.141.1624517860504; Wed, 23 Jun 2021 23:57:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdqChWxI2TqFhdGI9pdTdW0OY2cpxOML9ILwZzD3plJUW6I8N3vbOFGhbVC127GRhm0xAu2w== X-Received: by 2002:a05:6000:1889:: with SMTP id a9mr85587wri.141.1624517860347; Wed, 23 Jun 2021 23:57:40 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id o26sm1900491wmr.29.2021.06.23.23.57.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jun 2021 23:57:39 -0700 (PDT) Subject: Re: [PATCH 0/6] KVM: Remove uses of struct page from x86 and arm64 MMU To: David Stevens , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Zhenyu Wang , Zhi Wang Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Will Deacon , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, David Stevens References: <20210624035749.4054934-1-stevensd@google.com> From: Paolo Bonzini Message-ID: <20baae77-785c-5d46-e00c-41d86c2fbc56@redhat.com> Date: Thu, 24 Jun 2021 08:57:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210624035749.4054934-1-stevensd@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210623_235745_910733_A0CFB521 X-CRM114-Status: GOOD ( 22.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24/06/21 05:57, David Stevens wrote: > KVM supports mapping VM_IO and VM_PFNMAP memory into the guest by using > follow_pte in gfn_to_pfn. However, the resolved pfns may not have > assoicated struct pages, so they should not be passed to pfn_to_page. > This series removes such calls from the x86 and arm64 secondary MMU. To > do this, this series modifies gfn_to_pfn to return a struct page in > addition to a pfn, if the hva was resolved by gup. This allows the > caller to call put_page only when necessated by gup. > > This series provides a helper function that unwraps the new return type > of gfn_to_pfn to provide behavior identical to the old behavior. As I > have no hardware to test powerpc/mips changes, the function is used > there for minimally invasive changes. Additionally, as gfn_to_page and > gfn_to_pfn_cache are not integrated with mmu notifier, they cannot be > easily changed over to only use pfns. > > This addresses CVE-2021-22543 on x86 and arm64. Thank you very much for this. I agree that it makes sense to have a minimal change; I had similar changes almost ready, but was stuck with deadlocks in the gfn_to_pfn_cache case. In retrospect I should have posted something similar to your patches. I have started reviewing the patches, and they look good. I will try to include them in 5.13. Paolo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel