Message ID | 20201119144146.1045202-11-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=R53y=EZ=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 92074C63697 for <linux-arm-kernel@archiver.kernel.org>; Thu, 19 Nov 2020 15:03:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 000A120867 for <linux-arm-kernel@archiver.kernel.org>; Thu, 19 Nov 2020 15:03:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MhRs13HP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="d+2XVLWr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="lhtA9EHT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 000A120867 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=REFjMEWsSAB8XVaDGKcVix9zoY7KmWsuGWic1hFBbhg=; b=MhRs13HPO420zRf5TtkZRUNGq jYwaA6a+eljohnTcxuyiTEDrXieC2xauUwjSf3w6uT7QZ9lBhr5OEHyz0qr9wBV0fibFxF4hSxNvo jdRPAwU9r6tvGXn7poZVEpFFpE+Am9JvLhYL7o+PRg9jDJfFUxogqJqi7dlGNOrXE0bJ1i+/Ffuqh 0wTtx61wIeWpwufMXQSKTQSArjsVJUmd3oGkPd1mlJk8dXmaAzXWW0o9oy84h81g6+UNOv2A90qet 0Y0cmzwMcb6nlNGl4lEfQbcip9qBOj6pD5PGbL+amtYCi9PG3tfCVFONf8U84l7cWGLHeBP0LjJsV 6H3T0igRQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kflRo-0008SH-4e; Thu, 19 Nov 2020 15:02:08 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kflRZ-0008K3-IJ for linux-arm-kernel@merlin.infradead.org; Thu, 19 Nov 2020 15:01:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description; bh=r9CpIi9VXsG+zuZeNFc6wtzpnBA/KWk/gpfUTZT1Zjk=; b=d+2XVLWr4PI7dUbmyCiP7dco8g s45XmyStTLsBbEbu+GhymxoGXfKczvxx063xkLq0DH0JlK09T3SsBrr0j7+w16MVsc8p7NvdJyC8D 7AMEREzvmSXIB4r12I4LRQ3XFEKVxvMKeZ+Kr423D0k8FhBtM42n3IXj3jB/ag+4dRAzWzdBDSQND 3rnt6wEPjGs8N29ncWT4b/jpxdIZVaSd4Tnw3fHrYTSSKQrA0qgixvR9OT+mF529kIK/EC2n0PAqk 36n3xIp89DPnCrdWksC00g75F2o/AnBDku65l7eKw5s8HKBWJSqrji4nAVUou6RcmWtSflKhNmCD3 71rQ3gEw==; Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfl8U-0000Dj-O6 for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2020 14:42:15 +0000 Received: by mail-wm1-x341.google.com with SMTP id p22so7424495wmg.3 for <linux-arm-kernel@lists.infradead.org>; Thu, 19 Nov 2020 06:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r9CpIi9VXsG+zuZeNFc6wtzpnBA/KWk/gpfUTZT1Zjk=; b=lhtA9EHTSs14S/lWfBd1cIy0B+1WAFjZ2wwrxe0xfxaPFoO4tE/BV8FsM/+QBdNKSb qaDof6bo+sV1dmoR3pr9L3cROFnjeyDX7YUhLjLaTr5vvJuZGC/AQ8qhGDGYOPWuK2ES DXV+m9I+q0gCIequCxlA9xJnLLr4u+Z/5Mgjs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r9CpIi9VXsG+zuZeNFc6wtzpnBA/KWk/gpfUTZT1Zjk=; b=Q+qg8LiMrcagI1V8KTx0AGprTtCW6em186HG0ifjcSbGCUqW/CWLdRsY7jXERXQXPH s2+b2mKkdAwK1VyRZkA5LsRLGaD3OwTtEQ+FtfUQ721ySx5hJbRVNTPwNUWnwgExs/R6 4rUT7cqbEuZNH1Y4j6Qsik4X37aSMGrzl41WdxZUsLwpnjZlKJBRqibC2UWxqy7qIAwf VsXcROPoaDEYRGCuren3jMFq2i/bFdpo2vNynflOZWSs7wau4KcNZSADSQq8F6islKqa 652OkV7Zeow3hAQMVL+VVSoyL9bNfdu0UWjvWf7YTD1YqSndT9f7k80JRjqcQv5EBcGb q1JA== X-Gm-Message-State: AOAM532DOjT35E/NTjcK5yUH1Kme2rZzrlX2hvuDgk340CwEveTvzpIt XR1EhNxTZbBM7OA7Jp8ZZjgCAg== X-Google-Smtp-Source: ABdhPJwmTNYcq6djsIakV7SIgJh96B+fhnfkl7M76m7WAG1RYZMmoYFSDpdjObIHYtpegBgvRnmxPg== X-Received: by 2002:a05:600c:288:: with SMTP id 8mr4943834wmk.106.1605796926931; Thu, 19 Nov 2020 06:42:06 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id x63sm51292wmb.48.2020.11.19.06.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 06:42:06 -0800 (PST) From: Daniel Vetter <daniel.vetter@ffwll.ch> To: DRI Development <dri-devel@lists.freedesktop.org>, LKML <linux-kernel@vger.kernel.org> Subject: [PATCH v6 10/17] vfio/type1: Mark follow_pfn as unsafe Date: Thu, 19 Nov 2020 15:41:39 +0100 Message-Id: <20201119144146.1045202-11-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201119144146.1045202-1-daniel.vetter@ffwll.ch> References: <20201119144146.1045202-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_144211_462054_7E2D9D5C X-CRM114-Status: GOOD ( 18.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: linux-samsung-soc@vger.kernel.org, Jan Kara <jack@suse.cz>, Kees Cook <keescook@chromium.org>, kvm@vger.kernel.org, Jason Gunthorpe <jgg@ziepe.ca>, Daniel Vetter <daniel.vetter@ffwll.ch>, Cornelia Huck <cohuck@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, linux-mm@kvack.org, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= <jglisse@redhat.com>, John Hubbard <jhubbard@nvidia.com>, Daniel Vetter <daniel.vetter@intel.com>, Dan Williams <dan.j.williams@intel.com>, Andrew Morton <akpm@linux-foundation.org>, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
follow_pfn and other iomap races
|
expand
|
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 67e827638995..10170723bb58 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -421,7 +421,7 @@ static int follow_fault_pfn(struct vm_area_struct *vma, struct mm_struct *mm, { int ret; - ret = follow_pfn(vma, vaddr, pfn); + ret = unsafe_follow_pfn(vma, vaddr, pfn); if (ret) { bool unlocked = false; @@ -435,7 +435,7 @@ static int follow_fault_pfn(struct vm_area_struct *vma, struct mm_struct *mm, if (ret) return ret; - ret = follow_pfn(vma, vaddr, pfn); + ret = unsafe_follow_pfn(vma, vaddr, pfn); } return ret;