[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201009105803.GA505688@kroah.com>
Date: Fri, 9 Oct 2020 12:58:03 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: DRI Development <dri-devel@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>, kvm@...r.kernel.org,
linux-mm@...ck.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-media@...r.kernel.org,
linux-s390@...r.kernel.org,
Daniel Vetter <daniel.vetter@...el.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Kees Cook <keescook@...omium.org>,
Dan Williams <dan.j.williams@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
John Hubbard <jhubbard@...dia.com>,
Jérôme Glisse <jglisse@...hat.com>,
Jan Kara <jack@...e.cz>, Bjorn Helgaas <bhelgaas@...gle.com>,
linux-pci@...r.kernel.org, "Rafael J. Wysocki" <rafael@...nel.org>,
Christian Brauner <christian.brauner@...ntu.com>,
"David S. Miller" <davem@...emloft.net>,
Michael Ellerman <mpe@...erman.id.au>,
Sourabh Jain <sourabhjain@...ux.ibm.com>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Nayna Jain <nayna@...ux.ibm.com>
Subject: Re: [PATCH v2 15/17] sysfs: Support zapping of binary attr mmaps
On Fri, Oct 09, 2020 at 09:59:32AM +0200, Daniel Vetter wrote:
> We want to be able to revoke pci mmaps so that the same access rules
> applies as for /dev/kmem. Revoke support for devmem was added in
> 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims the
> region").
>
> The simplest way to achieve this is by having the same filp->f_mapping
> for all mappings, so that unmap_mapping_range can find them all, no
> matter through which file they've been created. Since this must be set
> at open time we need sysfs support for this.
>
> Add an optional mapping parameter bin_attr, which is only consulted
> when there's also an mmap callback, since without mmap support
> allowing to adjust the ->f_mapping makes no sense.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@...el.com>
> Cc: Jason Gunthorpe <jgg@...pe.ca>
> Cc: Kees Cook <keescook@...omium.org>
> Cc: Dan Williams <dan.j.williams@...el.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: John Hubbard <jhubbard@...dia.com>
> Cc: Jérôme Glisse <jglisse@...hat.com>
> Cc: Jan Kara <jack@...e.cz>
> Cc: Dan Williams <dan.j.williams@...el.com>
> Cc: linux-mm@...ck.org
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: linux-samsung-soc@...r.kernel.org
> Cc: linux-media@...r.kernel.org
> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> Cc: linux-pci@...r.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> Cc: Christian Brauner <christian.brauner@...ntu.com>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Michael Ellerman <mpe@...erman.id.au>
> Cc: Sourabh Jain <sourabhjain@...ux.ibm.com>
> Cc: Daniel Vetter <daniel.vetter@...ll.ch>
> Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> Cc: Nayna Jain <nayna@...ux.ibm.com>
> ---
> fs/sysfs/file.c | 11 +++++++++++
> include/linux/sysfs.h | 2 ++
> 2 files changed, 13 insertions(+)
Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Powered by blists - more mailing lists