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: <Pine.LNX.4.64.0812051407130.25248@blonde.anvils>
Date:	Fri, 5 Dec 2008 14:12:31 +0000 (GMT)
From:	Hugh Dickins <hugh@...itas.com>
To:	David Howells <dhowells@...hat.com>
cc:	torvalds@...l.org, akpm@...ux-foundation.org, bfields@...ldses.org,
	hch@...radead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] EXPORTFS: Don't return NULL from fh_to_dentry()/fh_to_parent()
 [ver #2]

On Fri, 5 Dec 2008, David Howells wrote:
> Returning NULL from fh_to_dentry() and fh_to_parent() is not permitted, so
> return -ESTALE instead.  exportfs_decode_fh() does not check for NULL, but
> will try to dereference it as IS_ERR() does not check for it.
> 
> The generic_fh_to_dentry() and generic_fh_to_parent() functions also no longer
> return NULL, but return -ESTALE instead.
> 
> Signed-off-by: David Howells <dhowells@...hat.com>
> Acked-by: J. Bruce Fields <bfields@...i.umich.edu>

I think it's still wrong in shmem_fh_to_dentry(): you've fixed
the early return, but there'd be another return NULL if !inode?

Hugh

> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -2055,7 +2055,7 @@ static struct dentry *shmem_fh_to_dentry(struct super_block *sb,
>  	inum = (inum << 32) | fid->raw[1];
>  
>  	if (fh_len < 3)
> -		return NULL;
> +		return ERR_PTR(-ESTALE);
>  
>  	inode = ilookup5(sb, (unsigned long)(inum + fid->raw[0]),
>  			shmem_match, fid->raw);
> 
--
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