Message ID | 20201026105818.2585306-12-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 702BBC55178 for <linux-arm-kernel@archiver.kernel.org>; Mon, 26 Oct 2020 11:02:52 +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 28917207DE for <linux-arm-kernel@archiver.kernel.org>; Mon, 26 Oct 2020 11:02:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rHjMEZc8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZKPGj+0b"; 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 28917207DE 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=R7U8yAvcJh1TIOoNKZz88RSyAoTSzrhbMoG3ezwfiWU=; b=rHjMEZc8EJI70Ffh2+jIEXMAk qc9H3mVzfy8L0nYik13ajZxmOvwuHHyRIwO5FjOIjqwYK9oofBReiRASVN3df+S/+sSX39TF+rKSl sZynv/QaA9BiBwpRYlodLifdOaUzqzbKneUlmBt+mo36eg3JLI0Z0Wf4w8hvgVtA4eBbejgTzeK9n 5NSjFYmvFMgCbEvaKMj/Yw7RcMAxKaLbXtKSIhjJ/dm1NFlf/A8IPjtrbOJOIGBOqGS97B/n/KXBH Td5vhtgZyRQOJ7Stb4vp6jsHuC10+iTe/cyO/ycgkngMOycpUc0Pi6wGKNaN7H41uZbHquKhHWnk7 RybNFR5Vw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX0FC-0002x5-QC; Mon, 26 Oct 2020 11:00:54 +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 1kX0DC-00027G-W7 for linux-arm-kernel@merlin.infradead.org; Mon, 26 Oct 2020 10:58:51 +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=5W4UqFTJMoDRzu7XpmV7m/mIx7tbXZK4TFNNVek8jNg=; b=ZKPGj+0bnxT7tRylR7TyuY2Euf TFDixoVfOj1zc8ymSWmSE9eFUepNarvJchieS7rPVrE1FFRV2GYwtz19YfIpaAhP77M0weLk4wzSa u7IbV19z2/RShnC/81l1ux6cJETN5Yzwfx5ttc2ql93YK1uOOEBIz/wNFmjB9avNhX+Rm9Uw/FURP zWv6M8cbIK2c9CEPhXCUIeASkkRBQwJAt3QJrdINxlsRP1rfwJPaEeP5D4AY9a6zpoi4RTSqW3nde oj4lzLE4tAni1Z21AR/4hWparbjkZwFd1NJZp3qtkU8t+8D2GvKDGZcsAWGaROVWPKX6fhtexHD+d ATrR50rQ==; Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX0D7-0005cC-0r for linux-arm-kernel@lists.infradead.org; Mon, 26 Oct 2020 10:58:49 +0000 Received: by mail-wr1-x443.google.com with SMTP id e17so11866730wru.12 for <linux-arm-kernel@lists.infradead.org>; Mon, 26 Oct 2020 03:58:42 -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=bD0VH0cVJrORTKHg4h/VZ0yJwLbFOgrqSn2CO1URjp38PFTjIVt4CtFFRTt2QpngbG qxN8VeLriDMuRfTxl4eeesa1x9TiMLjMBh4ttS1iDGhDTbTsFYGIh7fmIZg/EKTnUWWI mACeEdQMpG9OwoxXqzL/cG2XaBSO8FZc4K92OKsbNIeS372Bh4ABISTYXwaDAiu2Vb9p r/596noDTVLuJhS+WA5RzkXe2HI/x0v6319zdkvIbxV6Zx5VCU4spyIgoObgMkbXDJTp xRAJW0L7VU1x8PFtHRjbY+HnNd4ITrCpRKxrrbLq7r6ekbun7P7mJ7cLkq34PwOT7IFk +Kmg== X-Gm-Message-State: AOAM531PjeNtGovZLT9b19ybzX3vNVHNpEGZLSGqFT8V+XtNijglshh7 z9kfNVNrfbWf29minVOC1bNNOw== 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> 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201026_105845_614459_B34D6163 X-CRM114-Status: GOOD ( 16.28 ) 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>, linux-pci@vger.kernel.org, linux-mm@kvack.org, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= <jglisse@redhat.com>, John Hubbard <jhubbard@nvidia.com>, Bjorn Helgaas <bhelgaas@google.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/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)