mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] smbfs chroot issue (CVE-2006-1864)
@ 2006-05-05  1:40 Chris Wright
  2006-05-05  5:37 ` Willy Tarreau
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Wright @ 2006-05-05  1:40 UTC (permalink / raw)
  To: torvalds
  Cc: linux-kernel, stable, Greg KH, Steven French, Marcel Holtmann,
	Olaf Kirch, Mark Moseley, shaggy

From: Olaf Kirch <okir@suse.de>

Mark Moseley reported that a chroot environment on a SMB share can be
left via "cd ..\\".  Similar to CVE-2006-1863 issue with cifs, this fix
is for smbfs.

Steven French <sfrench@us.ibm.com> wrote:

Looks fine to me.  This should catch the slash on lookup or equivalent,
which will be all obvious paths of interest.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
 This fix is in -stable, but doesn't appear to be in your tree yet.

 fs/smbfs/dir.c |    5 +++++
 1 file changed, 5 insertions(+)

--- linus-2.6.orig/fs/smbfs/dir.c
+++ linus-2.6/fs/smbfs/dir.c
@@ -434,6 +434,11 @@ smb_lookup(struct inode *dir, struct den
 	if (dentry->d_name.len > SMB_MAXNAMELEN)
 		goto out;
 
+	/* Do not allow lookup of names with backslashes in */
+	error = -EINVAL;
+	if (memchr(dentry->d_name.name, '\\', dentry->d_name.len))
+		goto out;
+
 	lock_kernel();
 	error = smb_proc_getattr(dentry, &finfo);
 #ifdef SMBFS_PARANOIA

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] smbfs chroot issue (CVE-2006-1864)
  2006-05-05  1:40 [PATCH] smbfs chroot issue (CVE-2006-1864) Chris Wright
@ 2006-05-05  5:37 ` Willy Tarreau
  0 siblings, 0 replies; 2+ messages in thread
From: Willy Tarreau @ 2006-05-05  5:37 UTC (permalink / raw)
  To: marcelo; +Cc: linux-kernel, Chris Wright, Steven French, Mark Moseley

Marcelo,

This patch also applies to 2.4, did you receive it on your side or do you
want me to queue it in -upstream ?

Regards,
Willy

On Thu, May 04, 2006 at 06:40:41PM -0700, Chris Wright wrote:
> From: Olaf Kirch <okir@suse.de>
> 
> Mark Moseley reported that a chroot environment on a SMB share can be
> left via "cd ..\\".  Similar to CVE-2006-1863 issue with cifs, this fix
> is for smbfs.
> 
> Steven French <sfrench@us.ibm.com> wrote:
> 
> Looks fine to me.  This should catch the slash on lookup or equivalent,
> which will be all obvious paths of interest.
> 
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
> ---
>  This fix is in -stable, but doesn't appear to be in your tree yet.
> 
>  fs/smbfs/dir.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> --- linus-2.6.orig/fs/smbfs/dir.c
> +++ linus-2.6/fs/smbfs/dir.c
> @@ -434,6 +434,11 @@ smb_lookup(struct inode *dir, struct den
>  	if (dentry->d_name.len > SMB_MAXNAMELEN)
>  		goto out;
>  
> +	/* Do not allow lookup of names with backslashes in */
> +	error = -EINVAL;
> +	if (memchr(dentry->d_name.name, '\\', dentry->d_name.len))
> +		goto out;
> +
>  	lock_kernel();
>  	error = smb_proc_getattr(dentry, &finfo);
>  #ifdef SMBFS_PARANOIA
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-05  5:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-05  1:40 [PATCH] smbfs chroot issue (CVE-2006-1864) Chris Wright
2006-05-05  5:37 ` Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®