Message ID | 20201030100815.2269-11-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=uRYk=EF=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 40B411130 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 30 Oct 2020 10:09:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DDFC6221FF for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 30 Oct 2020 10:09:05 +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="ddb3ur1/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDFC6221FF 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 74AB06B0083; Fri, 30 Oct 2020 06:08:54 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6A9826B0085; Fri, 30 Oct 2020 06:08:54 -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 59DE66B0087; Fri, 30 Oct 2020 06:08:54 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 207696B0083 for <linux-mm@kvack.org>; Fri, 30 Oct 2020 06:08:54 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BEE991EF2 for <linux-mm@kvack.org>; Fri, 30 Oct 2020 10:08:53 +0000 (UTC) X-FDA: 77428168146.28.men42_420d81127295 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 98C266C26 for <linux-mm@kvack.org>; Fri, 30 Oct 2020 10:08:53 +0000 (UTC) X-Spam-Summary: 1,0,0,f288cb0438492775,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:12986: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;04yrpq1dyzpn3k1xtk38myanitnxoopgci3af69iyo1jieyda4xx1wpwupz8ca6.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:69,LUA_SUMMARY:none X-HE-Tag: men42_420d81127295 X-Filterd-Recvd-Size: 5291 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by imf25.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Fri, 30 Oct 2020 10:08:53 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id e2so2406853wme.1 for <linux-mm@kvack.org>; Fri, 30 Oct 2020 03:08:53 -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=oGBzVmmcnUwoCpcjwMRu//j69ndtXtCP0NS2ElhXzwU=; b=ddb3ur1/6UNkfQr4L91EGkmgAJ2WFlh64b3krQrxHdXICPqGD1U7KSjV8mliOcYT2T IQK1rF0Fay6IRnqi6Z1rjQW4mkT8UrxQsAja5X4I4Zb0BD7E8rZgI9L3j1sWoJXQiFP2 XQzGN/xa46QCrVP1PNnx5Jw7AGsn+9JT27UuU= 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=oGBzVmmcnUwoCpcjwMRu//j69ndtXtCP0NS2ElhXzwU=; b=MBDuxS25ZQl3eflwMmWQp9FtdU6kEQKaMAqY0mXB7COd51GasdazIyXFiVvdkygYUi wZabC+4mFxi37j2wLCw0NOb3g7AmYN8wq4wDa9z8ZkHvyt/7DTDukiEec2lgP1sgWevA TFtaEfvjK1c/6t7UY4q/bcYfjC8WM9ZXWbZhTZGSVc5Qqu8+EvExDSxwZWKMUHmS83uV BtZdQIHepeTcfFrHGnc/cwghxIN+/+U3eqLHl7CFtZj6N6MfQxFP1RrACAhFg+Ec6z5i hLxX4mchL7IMUaqMu0g67daiRw+Hg5zB9NOnrIWS2CyQa8tjl2XwJkQZ2shnX5KejT8y kBZg== X-Gm-Message-State: AOAM531c6tCZNrUMysu5x6dmL5apvRl6FcZGuBd8FewiekdvXpMSxPdR CytLxnIQzz7KFpXuCvXjGt9PGg== X-Google-Smtp-Source: ABdhPJwf6UH/CcQRHOKUtt59ycYpiu3snU7M2hjeYaaPa8vODJopyC6lafOLMLKP7+MR3NDzcDgM5Q== X-Received: by 2002:a7b:c309:: with SMTP id k9mr1632728wmj.125.1604052532224; Fri, 30 Oct 2020 03:08:52 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id v189sm4430947wmg.14.2020.10.30.03.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 03:08:51 -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, 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> Subject: [PATCH v5 10/15] vfio/type1: Mark follow_pfn as unsafe Date: Fri, 30 Oct 2020 11:08:10 +0100 Message-Id: <20201030100815.2269-11-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201030100815.2269-1-daniel.vetter@ffwll.ch> References: <20201030100815.2269-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 bb2684cc245e..eccfee900033 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;