[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250806171132.3402278-2-frank.li@vivo.com>
Date: Wed, 6 Aug 2025 11:11:29 -0600
From: Yangtao Li <frank.li@...o.com>
To: slava@...eyko.com,
glaubitz@...sik.fu-berlin.de,
Yangtao Li <frank.li@...o.com>
Cc: linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] hfs: abort hfs_lookup if name is too long
Long file names for hfs is 31 characters.
Signed-off-by: Yangtao Li <frank.li@...o.com>
---
fs/hfs/dir.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index 86a6b317b474..30f6194da939 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -25,6 +25,9 @@ static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry,
struct inode *inode = NULL;
int res;
+ if (dentry->d_name.len > HFS_NAMELEN)
+ return ERR_PTR(-ENAMETOOLONG);
+
res = hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd);
if (res)
return ERR_PTR(res);
--
2.48.1
Powered by blists - more mailing lists