Message ID | 20201026105818.2585306-11-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=Pxyr=EB=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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 404EDC2D0A3 for <linux-arm-kernel@archiver.kernel.org>; Mon, 26 Oct 2020 11:03:15 +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 BA5522224A for <linux-arm-kernel@archiver.kernel.org>; Mon, 26 Oct 2020 11:03:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wDhCL/Zg"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Cr+pmJXJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA5522224A 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=V0aCcc/azKjz7y7l2dLJ4MvKTTJMOoeOHtqclU+gOGY=; b=wDhCL/ZgYw3IpP8BepX4Z9BWX brYV3a+x+IX/RfX6HqWXMPwPuyuRNZcLqzs7alLbuu2cgFgtqGufzXPsgnwy3BxeDMREwZsnQwfQJ yV39hUdN+uerfVVWpJ10rp9yWCYrme+xeRV2YFyfCcSpr5f9/7mOpLbPl6orKKhaiAlqaggZQA+lv oeShhpAccjOeoLW/vW9GHIERWLvQb7e1h8GFb0lXJ3V95z16EtxOW5PG0KbH10VkIojtRV7eeCQfW WmOulmz5EvBFD2bt+6/w96m56kp+B2PHXEqCfpAqnJeuxK+VjSRoEJ5mNlGd6GdUsIbxw2mCL/b20 xjo/UTPtA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX0FS-00036q-8w; Mon, 26 Oct 2020 11:01:10 +0000 Received: from mail-wm1-f67.google.com ([209.85.128.67]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX0D3-00022H-4A for linux-arm-kernel@lists.infradead.org; Mon, 26 Oct 2020 10:58:59 +0000 Received: by mail-wm1-f67.google.com with SMTP id e2so11985641wme.1 for <linux-arm-kernel@lists.infradead.org>; Mon, 26 Oct 2020 03:58:40 -0700 (PDT) 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=hp7lChw6Uow+58XPniSHemIeAoNErbB/sdK6im80Iug=; b=Cr+pmJXJLsWocfKRIRa/5RHLA7hSR2O/V8a+9H+OfOBLfntuyYXq0XvJAi9z0VTfHT o6muhLbGVgMDDFHz7pi7g0wbMI0xim0wkiLglb6gq1U7avKTlbLZaGt6brXdeBhZPYiG 7tcXzotmBBEhyDhg4r894G/MEQ31CzKNdntL0= 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=hp7lChw6Uow+58XPniSHemIeAoNErbB/sdK6im80Iug=; b=l5nFfr7XfV4kPNVNsywv8ZecYpoPu73YaxkU2s4X+WdypKqrieId7jw367qUW9H0AQ T83Ui1lnfo6TKyDrKQFjgwIDlrgMPu+gtyu5xjNg0nyq6pcPdtF6ieS+pRauO5200DF3 ls7cB+qrc3wryWBdhRDB9vjkvUh4TbKE9RjqjXuvXwwbuU+TkojX2NeKaWqcWDFpzzA/ nRjpjSmu2+Pfy8/BbEc3lUkQ8mKAl/AF89Z7VkYUgjp9d/+F//AJfwefuVcvdvviIXYs qIYCAgPlXVmLOYy+QIIuRpLErwP7RsR+JLD1SXMBiNDqZFJ7JB93SXe2uGqAnq2HvkMU f2OA== X-Gm-Message-State: AOAM531RdauV/Shu43fce8ZXAA2yIOgvZN9qFvn8rxODywnc7V9NagTO RQN4FSrBKo8pE8tLWsu8BSaGkg== X-Google-Smtp-Source: ABdhPJyXE1xnVL9rMrbjHo2QW8UsY5WSv6Qb5ykdefmn1P9qttdIUjS9wMyJqMVtlrB26EUB1SiNdg== X-Received: by 2002:a05:600c:25a:: with SMTP id 26mr14957501wmj.39.1603709919599; Mon, 26 Oct 2020 03:58:39 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id w83sm21165156wmg.48.2020.10.26.03.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 03:58:38 -0700 (PDT) From: Daniel Vetter <daniel.vetter@ffwll.ch> To: DRI Development <dri-devel@lists.freedesktop.org>, LKML <linux-kernel@vger.kernel.org> Subject: [PATCH v4 10/15] vfio/type1: Mark follow_pfn as unsafe Date: Mon, 26 Oct 2020 11:58:13 +0100 Message-Id: <20201026105818.2585306-11-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201026105818.2585306-1-daniel.vetter@ffwll.ch> References: <20201026105818.2585306-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-20201026_065841_997840_C4A38B4F X-CRM114-Status: GOOD ( 19.41 ) 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-s390@vger.kernel.org, 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 5fbf0c1f7433..a4d53f3d0a35 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;