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] [day] [month] [year] [list]
Date:	Fri, 5 Feb 2010 14:27:26 -0500
From:	Jeff Layton <jlayton@...hat.com>
To:	smfrench@...il.com
Cc:	linux-fsdevel@...r.kernel.org, linux-cifs-client@...ts.samba.org,
	linux-kernel@...r.kernel.org, stable@...nel.org,
	Dave Kleikamp <shaggy@...ux.vnet.ibm.com>
Subject: Re: [linux-cifs-client] [PATCH] cifs: fix length calculation for
 converted unicode readdir names

On Fri,  5 Feb 2010 13:14:00 -0500
Jeff Layton <jlayton@...hat.com> wrote:

> cifs_from_ucs2 returns the length of the converted name, including the
> length of the NULL terminator. We don't want to include the NULL
> terminator in the dentry name length however since that'll throw off the
> hash calculation for the dentry cache.
> 
> I believe that this is the root cause of several problems that have
> cropped up recently that seem to be papered over with the "noserverino"
> mount option. More confirmation of that would be good, but this is
> clearly a bug and it fixes at least one reproducible problem that
> was reported.
> 
> This patch fixes at least this reproducer in this kernel.org bug:
> 
>     http://bugzilla.kernel.org/show_bug.cgi?id=15088#c12
> 
> Reported-by: Bjorn Tore Sund <bjorn.sund@...uib.no>
> Signed-off-by: Jeff Layton <jlayton@...hat.com>
> Cc: stable@...nel.org

To be clear...I think we need to get this into mainline kernels ASAP.
It causes some very subtle bugs in inode refcounting and dcache
handling.

I suspect that it'll fix a number of other oddball problems that have
been reported recently too, but only time and testing will tell that
for sure.

Also, should add Shaggy's Acked-by:

Acked-by: Dave Kleikamp <shaggy@...ux.vnet.ibm.com>

> ---
>  fs/cifs/readdir.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
> index f84062f..f5618f8 100644
> --- a/fs/cifs/readdir.c
> +++ b/fs/cifs/readdir.c
> @@ -666,6 +666,7 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
>  					   min(len, max_len), nlt,
>  					   cifs_sb->mnt_cifs_flags &
>  						CIFS_MOUNT_MAP_SPECIAL_CHR);
> +		pqst->len -= nls_nullsize(nlt);
>  	} else {
>  		pqst->name = filename;
>  		pqst->len = len;


-- 
Jeff Layton <jlayton@...hat.com>
--
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