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]
Date:	Tue, 13 Mar 2012 14:33:27 +0100
From:	Miklos Szeredi <miklos@...redi.hu>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	viro@...IV.linux.org.uk, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, Trond.Myklebust@...app.com,
	sfrench@...ba.org, sage@...dream.net, ericvh@...il.com
Subject: Re: [PATCH 00/25] vfs: atomic open RFC

Christoph Hellwig <hch@...radead.org> writes:

> On Tue, Mar 13, 2012 at 12:00:05PM +0100, Miklos Szeredi wrote:
>> > Do we really need the opendata structure?
>> >
>> > It seems like we could just pass a struct path instead of the dentry
>> > passed directly and the vfsmount in it.  There should be no need to
>> > preallocate the file before calling into ->atomic_open, as it's only
>> > used to pass around f_flags - but we already pass that one to
>> > ->atomic_open directly and might as well pass it on to finish_open and
>> > allocate the file there.
>> 
>> We really don't want to get into the situation where the open fails
>> after a successful create(*).  Which means the file needs to be allocated
>> prior to calling ->atomic_open and needs to be passed to finish_open()
>> toghether with the vfsmount and dentry.
>> 
>> In the first version of the patch I set filp->f_path.mnt to nd->path.mnt
>> and passed the half initialized filp to ->atomic_open.  But then decided
>> that it's confusing for the filesystem code to deal with a half baked
>> filp (does it need to be fput on error?  etc...)
>> 
>> Doing it with an opaque opendata makes this cleaner I think.
>
> Make sense.  Can you throw in another cleanup patch to really just make
> it a pass-through and not also use it as a boolean flag if open_flags
> should be obeyed?  This probably will change sematincs for the various
> filesystems, but given that they should behave the same way that's a
> good thing.

It's not just that.  The filesystems will create some state if od is
non-NULL, which is released in f_op->release.  If od is always non-NULL
then the VFS has to call ->release on a dummy file, that file has to be
allocated, which might fail...  So this brings with it a couple of
issues that I didn't want to deal with.

But yes, it would probably be a good cleanup...

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ