Message ID | 20201026105818.2585306-12-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=wmCO=EB=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 339B592C for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 26 Oct 2020 10:58:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DD06B2240C for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 26 Oct 2020 10:58:51 +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="KLr497mr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD06B2240C 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 A251D6B007D; Mon, 26 Oct 2020 06:58:43 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 989986B007E; Mon, 26 Oct 2020 06:58:43 -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 6F39B6B0080; Mon, 26 Oct 2020 06:58:43 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0061.hostedemail.com [216.40.44.61]) by kanga.kvack.org (Postfix) with ESMTP id 3A3F96B007D for <linux-mm@kvack.org>; Mon, 26 Oct 2020 06:58:43 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D1F221EE6 for <linux-mm@kvack.org>; Mon, 26 Oct 2020 10:58:42 +0000 (UTC) X-FDA: 77413778484.14.rock87_0d096c527272 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id B512D18229837 for <linux-mm@kvack.org>; Mon, 26 Oct 2020 10:58:42 +0000 (UTC) X-Spam-Summary: 1,0,0,748bc48eb0361dc1,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:2393:2553:2559:2562:2901:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:3871:3872:5007:6261:6653:6742:7903:10004:10400:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12663:12679:12895:13069:13095:13161:13184:13229:13311:13357:13846:13894:14181:14394:14659:14721:21080:21433:21444:21451:21627:21990:30054:30064:30070:30090,0,RBL:209.85.221.67:@ffwll.ch:.lbl8.mailshell.net-62.8.0.100 66.201.201.201;04y8wsooq4hk1y3tij6wstwqki7p9yc7eqo7uf5bc6thm9pu9tw1jbet4zkujd9.n4oksd71jerhjgj161i8eotz5s4s3hdeon94wcydjfeep7r37cnczq5bbbxz8j1.y-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: rock87_0d096c527272 X-Filterd-Recvd-Size: 5157 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf02.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Mon, 26 Oct 2020 10:58:42 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id i1so11894724wro.1 for <linux-mm@kvack.org>; Mon, 26 Oct 2020 03:58:41 -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=5W4UqFTJMoDRzu7XpmV7m/mIx7tbXZK4TFNNVek8jNg=; b=KLr497mrTXuUWmZaofaXk1hyxgArLSK5Z8LFA7VwpBwSz2E3+nE1glgvLx0JiQdQzn dm5kaVp9H5reVf+JjmNdCZ0s9dozztPh2nQ4nrraI1YOy9mqE/zZOpL+5xkTYVff+uRk JdfMqSudDhC/KCWc2IX1OVFNm25KGK/VrwkWA= 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=5W4UqFTJMoDRzu7XpmV7m/mIx7tbXZK4TFNNVek8jNg=; b=k/wfC0XKsQRf5UyKPfoAZPiqMEcNinjHZOYrChzdGGnsuDjq2t5R7RrFHCfl/StUXJ GZWRX9IPtMMpc7/S1qK9te+8rA+29tTdh69WnwGlue9zSYDKBOPcG38mdvlGPh+32vxn ujqARy6Z884idwP8/3OPlWSQkguIpM3ANMOTz94DNMPRr2d+nNDRTpKboYjkBwk719DD Hkb43U7KsPbQ4cU6/z6/R+K1Q1ZtXRfy/e+ywU/2VYrge250fO7RjtRZlrWd+oHsKQqv gS3QuzsagX0O6LHtPiImmLgiIpjOyRsSfbKgkSUCByF45zzP0nHiMAfLzeI+hjkUUPPU 8X/A== X-Gm-Message-State: AOAM5311iDUu/IfP3nvd3xp5LeYmX5ZrXhfiBJobKWj+xNATTNGF/v8n /eHPvMnm/7yOFRNT1ZZzv+5frQ== X-Google-Smtp-Source: ABdhPJz2su0SrOVqm3DeypSb7RJN8qc1fEsNaBh1v2aKMDuErJYYfZ5yJi5C/1uI817lBc+Ai9qYTQ== X-Received: by 2002:adf:f3cb:: with SMTP id g11mr18177850wrp.210.1603709921142; Mon, 26 Oct 2020 03:58:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 03:58:40 -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>, Bjorn Helgaas <bhelgaas@google.com>, linux-pci@vger.kernel.org Subject: [PATCH v4 11/15] PCI: Obey iomem restrictions for procfs mmap Date: Mon, 26 Oct 2020 11:58:14 +0100 Message-Id: <20201026105818.2585306-12-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 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/pci/proc.c b/drivers/pci/proc.c index d35186b01d98..3a2f90beb4cb 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -274,6 +274,11 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) else return -EINVAL; } + + if (dev->resource[i].flags & IORESOURCE_MEM && + iomem_is_exclusive(dev->resource[i].start)) + return -EINVAL; + ret = pci_mmap_page_range(dev, i, vma, fpriv->mmap_state, write_combine); if (ret < 0)