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>] [day] [month] [year] [list]
Message-ID: <20071227103820.GA6213@localhost.sw.ru>
Date:	Thu, 27 Dec 2007 13:38:20 +0300
From:	Alexey Dobriyan <adobriyan@...ru>
To:	akpm@...l.org
Cc:	linux-kernel@...r.kernel.org
Subject: Re: + proc-remove-useless-checks-in-proc_register.patch added to -mm tree

In fact, Andrew, please, drop this patch. Fixing yet another race in
proc would be done by suppying PDE's with valid ->proc_fops before
proc_register(), so this patch would be effectively reverted.

>      proc-remove-useless-checks-in-proc_register.patch

> Subject: proc: remove useless checks in proc_register()
> From: Alexey Dobriyan <adobriyan@...ru>
> 
> Before proc_register() all PDEs are created by proc_create() which doesn't set
> ->proc_iops and ->proc_fops -- they're NULL.  So those branches in
> proc_register() are always taken.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@...ru>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
> 
>  fs/proc/generic.c |   15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff -puN fs/proc/generic.c~proc-remove-useless-checks-in-proc_register fs/proc/generic.c
> --- a/fs/proc/generic.c~proc-remove-useless-checks-in-proc_register
> +++ a/fs/proc/generic.c
> @@ -526,19 +526,14 @@ static int proc_register(struct proc_dir
>  	dp->low_ino = i;
>  
>  	if (S_ISDIR(dp->mode)) {
> -		if (dp->proc_iops == NULL) {
> -			dp->proc_fops = &proc_dir_operations;
> -			dp->proc_iops = &proc_dir_inode_operations;
> -		}
> +		dp->proc_fops = &proc_dir_operations;
> +		dp->proc_iops = &proc_dir_inode_operations;
>  		dir->nlink++;
>  	} else if (S_ISLNK(dp->mode)) {
> -		if (dp->proc_iops == NULL)
> -			dp->proc_iops = &proc_link_inode_operations;
> +		dp->proc_iops = &proc_link_inode_operations;
>  	} else if (S_ISREG(dp->mode)) {
> -		if (dp->proc_fops == NULL)
> -			dp->proc_fops = &proc_file_operations;
> -		if (dp->proc_iops == NULL)
> -			dp->proc_iops = &proc_file_inode_operations;
> +		dp->proc_fops = &proc_file_operations;
> +		dp->proc_iops = &proc_file_inode_operations;
>  	}
>  
>  	spin_lock(&proc_subdir_lock);

--
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