Message ID | 20201127164131.2244124-9-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=l2dh=FB=kvack.org=owner-linux-mm@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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 0419CC64E7B for <linux-mm@archiver.kernel.org>; Fri, 27 Nov 2020 16:42:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C1A9206D8 for <linux-mm@archiver.kernel.org>; Fri, 27 Nov 2020 16:42:17 +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="KobUOV0h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C1A9206D8 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 CC8A46B0075; Fri, 27 Nov 2020 11:42:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C01826B0078; Fri, 27 Nov 2020 11:42:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A779B6B007B; Fri, 27 Nov 2020 11:42:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 8599B6B0075 for <linux-mm@kvack.org>; Fri, 27 Nov 2020 11:42:10 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4BCE1180AD822 for <linux-mm@kvack.org>; Fri, 27 Nov 2020 16:42:10 +0000 (UTC) X-FDA: 77530765620.16.brain32_5e0c44127389 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 2F803100E690C for <linux-mm@kvack.org>; Fri, 27 Nov 2020 16:42:10 +0000 (UTC) X-HE-Tag: brain32_5e0c44127389 X-Filterd-Recvd-Size: 5172 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf02.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Fri, 27 Nov 2020 16:42:09 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id x22so5629280wmc.5 for <linux-mm@kvack.org>; Fri, 27 Nov 2020 08:42:09 -0800 (PST) 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=rOg+qp39SVj5WC86VkdFnTzL9jP06PEcpQhmqKQ3t14=; b=KobUOV0hD77WVAdN6sE1FCbuddcx+Y7JofzkUlxRd9nWy9jlHdO1T8SsUttmc9LdEH 18FkNkVd0nL6VbYr5rOcMNJq8lcpuHF9LitOz/7CtQcZOgTCuvVk9HlpE337IvJ3CeQo TbfkBVcsC/WpwsEsC3qnjZtZkVocnIVEGrM9Q= 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=rOg+qp39SVj5WC86VkdFnTzL9jP06PEcpQhmqKQ3t14=; b=A9OaaozMrRrW6DvyC0c3hHYkFZAndPJ1VpkVGyAqc17fpk7NEXz5st5qmsYuw0XQnt tS8Do6ZpSdbFxIcLTsxhVKf03nSQuLuufVCUvmiWQjBvky2ypmJ/mhpHk75wksc9VBu6 u0NGQMUZC8yWmMr5IN8mckJTDbmMKVWG7OzgNkIkjw7GEhHBMlkQPpfeGUQW72hzd3cK nrEJ+FbzftyXv3FDm+aJeXd/eE7l2CuGYGX7uJqM1vC+WssaXDMTO+o1gX0Ixj5fnZSP 5s7d24yb8+s59SoWGVnEoqHZiWwZnWqEmkuLHoqAwzGS3wp/qhI364Gieg8sPasGlwI4 8ugg== X-Gm-Message-State: AOAM532H6Pdzcu88ZQ3Z4emdO/D92jKFaa5QsjPgfyg3c99bWqpKok6A toZfize/JTJmnOin6Jq0mZoGlw== X-Google-Smtp-Source: ABdhPJzZvF4udC7vFRIpQiicdsquYnu262AHQt4sYjvK76p1I545qbyBbBNxGngNqssLcpNV9573Nw== X-Received: by 2002:a1c:4944:: with SMTP id w65mr10125938wma.50.1606495328317; Fri, 27 Nov 2020 08:42:08 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q12sm14859078wrx.86.2020.11.27.08.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 08:42:07 -0800 (PST) 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>, Bjorn Helgaas <bhelgaas@google.com>, 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>, linux-pci@vger.kernel.org Subject: [PATCH v7 08/17] PCI: Obey iomem restrictions for procfs mmap Date: Fri, 27 Nov 2020 17:41:22 +0100 Message-Id: <20201127164131.2244124-9-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201127164131.2244124-1-daniel.vetter@ffwll.ch> References: <20201127164131.2244124-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)