[PATCH] vfs: initialize d_iname to null for long file names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dentry->d_iname is currently uninitialized for long file names.  Init
it to null string to avoid bad behaviors on careless references to it.

Signed-off-by: Wu Fengguang <wfg@xxxxxxxxxxxxxxx>
---
diff --git a/fs/dcache.c b/fs/dcache.c
index a1d86c7..29d1768 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -929,6 +929,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
 			kmem_cache_free(dentry_cache, dentry); 
 			return NULL;
 		}
+		dentry->d_iname[0] = '\0';
 	} else  {
 		dname = dentry->d_iname;
 	}	
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux