diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c index e406288787..8c8ec24147 100644 --- a/module/zfs/zpl_inode.c +++ b/module/zfs/zpl_inode.c @@ -41,6 +41,9 @@ zpl_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) struct inode *ip; int error; + if (dlen(dentry) > ZFS_MAXNAMELEN) + return ERR_PTR(-ENAMETOOLONG); + crhold(cr); error = -zfs_lookup(dir, dname(dentry), &ip, 0, cr, NULL, NULL); ASSERT3S(error, <=, 0);