[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250806171132.3402278-3-frank.li@vivo.com>
Date: Wed, 6 Aug 2025 11:11:30 -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 2/2] hfsplus: abort hfsplus_lookup if name is too long
Long file names for hfs is 255 characters.
Signed-off-by: Yangtao Li <frank.li@...o.com>
---
fs/hfsplus/dir.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index 876bbb80fb4d..d8fb401e7fdc 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -38,6 +38,9 @@ static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry,
u32 cnid, linkid = 0;
u16 type;
+ if (dentry->d_name.len > HFSPLUS_MAX_STRLEN)
+ return ERR_PTR(-ENAMETOOLONG);
+
sb = dir->i_sb;
dentry->d_fsdata = NULL;
--
2.48.1
Powered by blists - more mailing lists