Message ID | 20201021085655.1192025-12-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=inpt=D4=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E824014B4 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 21 Oct 2020 08:57:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9F5BD2245F for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 21 Oct 2020 08:57:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Ijq3ip5+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F5BD2245F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D3C16B0078; Wed, 21 Oct 2020 04:57:21 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2AB696B007B; Wed, 21 Oct 2020 04:57:21 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1298B6B007D; Wed, 21 Oct 2020 04:57:20 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id C99846B0078 for <linux-mm@kvack.org>; Wed, 21 Oct 2020 04:57:20 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 639D6181AC9CC for <linux-mm@kvack.org>; Wed, 21 Oct 2020 08:57:20 +0000 (UTC) X-FDA: 77395328640.22.cord91_0603d8e27247 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 24A9818038E60 for <linux-mm@kvack.org>; Wed, 21 Oct 2020 08:57:20 +0000 (UTC) X-Spam-Summary: 1,0,0,95705a6a0672bfa6,d41d8cd98f00b204,daniel.vetter@ffwll.ch,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1535:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2693:2901:2903:3138:3139:3140:3141:3142:3353:3865:3867:3871:3874:4321:5007:6117:6119:6261:6653:6742:7903:10004:10400:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12895:13069:13161:13229:13311:13357:13846:13894:14096:14097:14181:14394:14659:14721:21080:21444:21451:21627:21939:21990:30012:30054:30064:30090,0,RBL:209.85.128.66:@ffwll.ch:.lbl8.mailshell.net-62.8.0.100 66.201.201.201;04yfts94diks77z5fiik8uy8ta4uuypgci3af69iyo1jieyda4xx1wpwupz8ca6.hkhebehsqj36hkza8y6t7q74nff7jituttyqihwmabubz1bbqqd7cgb7bdxa34a.g-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: cord91_0603d8e27247 X-Filterd-Recvd-Size: 5372 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by imf22.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Wed, 21 Oct 2020 08:57:19 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id b127so897130wmb.3 for <linux-mm@kvack.org>; Wed, 21 Oct 2020 01:57:19 -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=8pur25W5Shkh1hHfFCpksS7ceNn2PKF9z82vTsiLN4c=; b=Ijq3ip5+wV7cd7njUb6RsVnXV8g8Owp5iMrdu9TyvAk5qDDhPeT5XCXN2ALGJhsrbp P5zOBKKXwRlNfH4L8OnR7mPoL971Mg4a7xN8q3N/PXmFtuMp/lDcW0snMDX7TnNSFxlk g5M5E6R5TEskXfmkH4sQcqsHcoV8Z7W9kahWs= 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=8pur25W5Shkh1hHfFCpksS7ceNn2PKF9z82vTsiLN4c=; b=Ad/j60YVDMxHqQ+H6VvM9SB186fiBwgPJUFcUFy406QFCBjSBBAOqu6zgfWuX81c8e VFCBl6h9/qJLpOaf5bJNhdpyJ9hFQ7hFJTc1DbFj8xg3UZEjTcpqviso7cn2VgfOh0Id RvLYsVT8Ns4+1x7oBnxrusYfee9mMENUU5WzUHrckgXz5PB57Zo8Js4yL0jYpj2dJcvC zP0LfLFm8Gz/a7K8iRyFBUsnqo4b5MVsgL4VWdcR31HJfwacWgivLhxMAGRg9TenQfHc q37crpMMpPAlcI/CC2wHD0XUpul9X41sIADn3VAlhqm26Nu4o6T/Bt26ZsxiALo+LJ9T dwxQ== X-Gm-Message-State: AOAM530WDPo5MiWnduSrDLM2JISauzC8EmuzxnrdICutpKXcGBn7NRbI cvy5ty1r7CTYrLo6IYBYW/YUwQ== X-Google-Smtp-Source: ABdhPJzNaFnr3EWeDP7k0cF2AHbtycSZcq0l7yhT5Nq82x3yeqTKgKPKUR9qmyptj9g+y8CFHwWMGg== X-Received: by 2002:a1c:2c02:: with SMTP id s2mr2512532wms.66.1603270638556; Wed, 21 Oct 2020 01:57:18 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q8sm2675939wro.32.2020.10.21.01.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 01:57:17 -0700 (PDT) From: Daniel Vetter <daniel.vetter@ffwll.ch> To: DRI Development <dri-devel@lists.freedesktop.org>, LKML <linux-kernel@vger.kernel.org> Cc: kvm@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, linux-s390@vger.kernel.org, Daniel Vetter <daniel.vetter@ffwll.ch>, Daniel Vetter <daniel.vetter@intel.com>, Jason Gunthorpe <jgg@ziepe.ca>, Kees Cook <keescook@chromium.org>, Dan Williams <dan.j.williams@intel.com>, Andrew Morton <akpm@linux-foundation.org>, John Hubbard <jhubbard@nvidia.com>, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= <jglisse@redhat.com>, Jan Kara <jack@suse.cz>, Alex Williamson <alex.williamson@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Daniel Vetter <daniel.vetter@ffwll.com> Subject: [PATCH v3 11/16] vfio/type1: Mark follow_pfn as unsafe Date: Wed, 21 Oct 2020 10:56:50 +0200 Message-Id: <20201021085655.1192025-12-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201021085655.1192025-1-daniel.vetter@ffwll.ch> References: <20201021085655.1192025-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.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;