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: <20180610044050.GL30522@ZenIV.linux.org.uk>
Date:   Sun, 10 Jun 2018 05:41:07 +0100
From:   Al Viro <viro@...IV.linux.org.uk>
To:     Miklos Szeredi <mszeredi@...hat.com>
Cc:     linux-unionfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/39] vfs: optionally don't account file in nr_files

On Tue, May 29, 2018 at 04:43:05PM +0200, Miklos Szeredi wrote:
> +++ b/fs/open.c
> @@ -732,8 +732,8 @@ static int do_dentry_open(struct file *f,
>  	static const struct file_operations empty_fops = {};
>  	int error;
>  
> -	f->f_mode = OPEN_FMODE(f->f_flags) | FMODE_LSEEK |
> -				FMODE_PREAD | FMODE_PWRITE;
> +	f->f_mode = (f->f_mode & FMODE_NOACCOUNT) | OPEN_FMODE(f->f_flags) |
> +		FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;

Why bother with this complexity?  I mean, why not simply
	f->f_mode |= OPEN_FMODE(f->f_flags) | FMODE_LSEEK |
				FMODE_PREAD | FMODE_PWRITE;

and be done with that...

> @@ -743,7 +743,7 @@ static int do_dentry_open(struct file *f,
>  	f->f_wb_err = filemap_sample_wb_err(f->f_mapping);
>  
>  	if (unlikely(f->f_flags & O_PATH)) {
> -		f->f_mode = FMODE_PATH;
> +		f->f_mode = (f->f_mode & FMODE_NOACCOUNT) | FMODE_PATH;

That makes no sense at all.  What would ever pass O_PATH opens
from "noaccount" call site?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ