lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69dc6610-e70a-46ca-a6e9-7ca183eb055c@deltatee.com>
Date: Fri, 7 Jun 2024 10:16:58 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: Christoph Hellwig <hch@...radead.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Martin Oliveira <martin.oliveira@...eticom.com>,
 linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-pci@...r.kernel.org, linux-mm@...ck.org, Jason Gunthorpe
 <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>,
 Bjorn Helgaas <bhelgaas@...gle.com>, Tejun Heo <tj@...nel.org>,
 "Rafael J. Wysocki" <rafael@...nel.org>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Mike Marciniszyn <mike.marciniszyn@...el.com>,
 Michael Guralnik <michaelgur@...dia.com>,
 Dan Williams <dan.j.williams@...el.com>, Ard Biesheuvel <ardb@...nel.org>,
 Valentine Sinitsyn <valesini@...dex-team.ru>, Lukas Wunner <lukas@...ner.de>
Subject: Re: [PATCH 1/6] kernfs: create vm_operations_struct without
 page_mkwrite()



On 2024-06-06 23:03, Christoph Hellwig wrote:
> On Thu, Jun 06, 2024 at 10:54:06PM +0200, Greg Kroah-Hartman wrote:
>> On Wed, Jun 05, 2024 at 01:29:29PM -0600, Martin Oliveira wrote:
>>> The standard kernfs vm_ops installs a page_mkwrite() operator which
>>> modifies the file update time on write.
>>>
>>> This not always required (or makes sense), such as in the P2PDMA, which
>>> uses the sysfs file as an allocator from userspace.
>>
>> That's not a good idea, please don't do that.  sysfs binary files are
>> "pass through", why would you want to use this as an allocator?
> 
> I think the real question is why sysfs binary files implement
> page_mkwrite by default.  page_mkwrite is needed for file systems that
> need to allocate space from a free space pool, which seems odd for
> sysfs.

The default page_mkwrite in kernfs just calls file_update_time() but, as
I understand it, the fault code should call file_update_time() if
page_mkwrite isn't set. So perhaps the easiest thing is to simply not
add a page_mkwrite unless the vm_ops adds one.

It's not the easiest thing to trace, but as best as I can tell there are
no kernfs binary attributes that use page_mkwrite. So alternatively,
perhaps we could just disallow page_mkwrite in kernfs entirely?

Logan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ