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]
Date:	Thu, 23 Aug 2012 08:12:30 -0400
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	Cyrill Gorcunov <gorcunov@...nvz.org>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Al Viro <viro@...iv.linux.org.uk>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Pavel Emelyanov <xemul@...allels.com>,
	James Bottomley <jbottomley@...allels.com>,
	Matthew Helsley <matt.helsley@...il.com>,
	aneesh.kumar@...ux.vnet.ibm.com
Subject: Re: [patch 4/9] fs, exportfs: Fix nil dereference if no
 s_export_op present

On Thu, Aug 23, 2012 at 02:43:27PM +0400, Cyrill Gorcunov wrote:
> If there is no s_export_op present in a target superblock
> we might have nil dereference.

Is that NULL dereference possible with current code, or is it a check
you're adding to account for a new caller that you're about to add?

I believe it's the latter, but this would be a good thing to make clear
in the changelog.

--b.

> Fix it with eplicit test
> if s_export_op is provided.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
> CC: Pavel Emelyanov <xemul@...allels.com>
> CC: Al Viro <viro@...IV.linux.org.uk>
> CC: Alexey Dobriyan <adobriyan@...il.com>
> CC: Andrew Morton <akpm@...ux-foundation.org>
> CC: James Bottomley <jbottomley@...allels.com>
> CC: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
> CC: Alexey Dobriyan <adobriyan@...il.com>
> CC: Matthew Helsley <matt.helsley@...il.com>
> CC: "J. Bruce Fields" <bfields@...ldses.org>
> CC: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
> ---
>  fs/exportfs/expfs.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6.git/fs/exportfs/expfs.c
> ===================================================================
> --- linux-2.6.git.orig/fs/exportfs/expfs.c
> +++ linux-2.6.git/fs/exportfs/expfs.c
> @@ -357,7 +357,7 @@ int exportfs_encode_fh(struct dentry *de
>  		 */
>  		parent = p->d_inode;
>  	}
> -	if (nop->encode_fh)
> +	if (nop && nop->encode_fh)
>  		error = nop->encode_fh(inode, fid->raw, max_len, parent);
>  	else
>  		error = export_encode_fh(inode, fid, max_len, parent);
> 
--
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