[ 3.8.y.z extended stable ] Patch "fuse: readdir: check for slash in names" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Fri Sep 20 00:36:24 UTC 2013

This is a note to let you know that I have just added a patch titled

    fuse: readdir: check for slash in names

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:


This patch is scheduled to be released in version

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see



>From ddb3c9be45d2ee16d165dcf529fcab4acd5591fe Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <mszeredi at suse.cz>
Date: Tue, 3 Sep 2013 14:28:38 +0200
Subject: fuse: readdir: check for slash in names

commit efeb9e60d48f7778fdcad4a0f3ad9ea9b19e5dfd upstream.

Userspace can add names containing a slash character to the directory
listing.  Don't allow this as it could cause all sorts of trouble.

Signed-off-by: Miklos Szeredi <mszeredi at suse.cz>
[ kamal: backport to 3.8 (no dirplus) ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 fs/fuse/dir.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 54a24fc..146276a 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1148,6 +1148,8 @@ static int parse_dirfile(char *buf, size_t nbytes, struct file *file,
 			return -EIO;
 		if (reclen > nbytes)
+		if (memchr(dirent->name, '/', dirent->namelen) != NULL)
+			return -EIO;

 		over = filldir(dstbuf, dirent->name, dirent->namelen,
 			       file->f_pos, dirent->ino, dirent->type);

More information about the kernel-team mailing list