Skip to contentSkip to conversation

fs: ext4: fix symlink read function

PATCH New Stefan Roese 2 participants 2 messages Apr 28, 2016 – May 2, 2016 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fs: ext4: fix symlink read function

From: Ronald Zachariah <[email protected]>

The function ext4fs_read_symlink was unable to handle a symlink which had target name of exactly 60 characters.

---
v2:
- Change '60' to sizeof(diro->inode.b.symlink) as suggested by Stephen

 fs/ext4/ext4_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/ext4_common.c +1 -1
index 84fba76..40b798a 100644
@@ -2040,7 +2040,7 @@ static char *ext4fs_read_symlink(struct ext2fs_node *node)
 	if (!symlink)
 		return 0;
 
-	if (__le32_to_cpu(diro->inode.size) <= 60) {
+	if (__le32_to_cpu(diro->inode.size) < sizeof(diro->inode.b.symlink)) {
 		strncpy(symlink, diro->inode.b.symlink,
 			 __le32_to_cpu(diro->inode.size));
 	} else {
Signature · 1 line
2.8.1
#1 lore raw

PATCH v2 1/1 fs: ext4: fix symlink read function

Quoted 9 lines · Stefan Roese

From: Ronald Zachariah <[email protected]>

The function ext4fs_read_symlink was unable to handle a symlink which had target name of exactly 60 characters.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160502/ee70d77a/attachment.sig>