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: <173493877280.11072.5624032826602566309@noble.neil.brown.name>
Date: Mon, 23 Dec 2024 18:26:12 +1100
From: "NeilBrown" <neilb@...e.de>
To: "Al Viro" <viro@...iv.linux.org.uk>
Cc: "Christian Brauner" <brauner@...nel.org>, "Jan Kara" <jack@...e.cz>,
 "Linus Torvalds" <torvalds@...ux-foundation.org>,
 linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/11] VFS: introduce vfs_mkdir_return()

On Mon, 23 Dec 2024, Al Viro wrote:
> On Fri, Dec 20, 2024 at 01:54:19PM +1100, NeilBrown wrote:
> > +	error = dir->i_op->mkdir(idmap, dir, dentry, mode);
> > +	if (!error) {
> > +		fsnotify_mkdir(dir, dentry);
> > +		if (unlikely(d_unhashed(dentry))) {
> > +			struct dentry *d;
> > +			d = lookup_dcache((const struct qstr *)&dentry->d_name,
> > +					  dentry->d_parent, 0);
> > +			if (IS_ERR(d)) {
> > +				error = PTR_ERR(d);
> > +			} else if (unlikely(d_is_negative(d))) {
> 
> 
> ... which will instantly oops if there's no cached dentry with
> such name and parent.  lookup_dcache() is pure dcache lookup;
> it does *NOT* call ->lookup() on miss - just returns NULL.
> 

I originally had lookup_one_len() but realised that I don't really want
any of lookup_one_common() so optimised - badly.

Maybe I should go back to lookup_one_len().
Or maybe I can just insert
   if (!d)
       d = __lookup_slow(....->d_name, dentry->d_parent, 0);

I'll look more closely and see which seems best.

Thanks,
NeilBrown

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ