[PATCH 01/10] libext2fs: forbid creating symlinks using entire block

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

 



From: Eric Biggers <ebiggers@xxxxxxxxxx>

ext2fs_symlink() didn't count the NUL terminator when limiting the
symlink target length to fs->blocksize, so it could create symlinks
using the entire block.  Such symlinks are problematic because if
block_size == PAGE_SIZE (as is usually the case), then when following
such a symlink the kernel will truncate the last byte because it needs
to ensure the symlink page is NUL-terminated (see page_get_link()).
Perhaps for that reason, e2fsck considers such symlinks to be invalid
(although only if they use the traditional block list rather than an
extent tree, which seems to be another bug).

Fix this by counting the NUL terminator, thereby decreasing the maximum
accepted symlink target length by 1.  Note that this matches the
kernel's behavior in ext4_symlink().

This breaks the test 'f_create_symlinks' which was using debugfs to
create a 1024-byte symlink (not counting the NUL terminator) on a
1024-byte block filesystem.  Fix it by removing the leading '/' from the
test's symlink targets so that their lengths are decreased by 1.

Fixes: f01c1a6bce5e ("libext2fs: add the ext2fs_symlink() function")
Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
---
 lib/ext2fs/symlink.c           | 15 ++++++++-------
 tests/f_create_symlinks/expect | 26 +++++++++++++-------------
 tests/f_create_symlinks/script |  4 ++--
 3 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/lib/ext2fs/symlink.c b/lib/ext2fs/symlink.c
index 607396de..13bca6e9 100644
--- a/lib/ext2fs/symlink.c
+++ b/lib/ext2fs/symlink.c
@@ -41,9 +41,12 @@ errcode_t ext2fs_symlink(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t ino,
 
 	EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
 
-	/* The Linux kernel doesn't allow for links longer than a block */
+	/*
+	 * The Linux kernel doesn't allow for links longer than a block
+	 * (counting the NUL terminator)
+	 */
 	target_len = strnlen(target, fs->blocksize + 1);
-	if (target_len > fs->blocksize) {
+	if (target_len >= fs->blocksize) {
 		retval = EXT2_ET_INVALID_ARGUMENT;
 		goto cleanup;
 	}
@@ -51,10 +54,10 @@ errcode_t ext2fs_symlink(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t ino,
 	/*
 	 * Allocate a data block for slow links
 	 */
-	retval = ext2fs_get_mem(fs->blocksize+1, &block_buf);
+	retval = ext2fs_get_mem(fs->blocksize, &block_buf);
 	if (retval)
 		goto cleanup;
-	memset(block_buf, 0, fs->blocksize+1);
+	memset(block_buf, 0, fs->blocksize);
 	strncpy(block_buf, target, fs->blocksize);
 
 	memset(&inode, 0, sizeof(struct ext2_inode));
@@ -87,9 +90,7 @@ errcode_t ext2fs_symlink(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t ino,
 	ext2fs_inode_size_set(fs, &inode, target_len);
 	/* The time fields are set by ext2fs_write_new_inode() */
 
-	inlinelink = !fastlink &&
-		     ext2fs_has_feature_inline_data(fs->super) &&
-		     (target_len < fs->blocksize);
+	inlinelink = !fastlink && ext2fs_has_feature_inline_data(fs->super);
 	if (fastlink) {
 		/* Fast symlinks, target stored in inode */
 		strcpy((char *)&inode.i_block, target);
diff --git a/tests/f_create_symlinks/expect b/tests/f_create_symlinks/expect
index 44093855..1794e0a7 100644
--- a/tests/f_create_symlinks/expect
+++ b/tests/f_create_symlinks/expect
@@ -6,40 +6,40 @@ Pass 4: Checking reference counts
 Pass 5: Checking group summary information
 test_filesys: 11/128 files (0.0% non-contiguous), 441/1024 blocks
 Exit status is 0
-debugfs -R "symlink /l_30 /xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img
-debugfs -R "symlink /l_70 /xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img
-debugfs -R "symlink /l_500 /xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" test.img
 ext2fs_symlink: Invalid argument passed to ext2 library while creating symlink "l_1500"
 symlink: Invalid argument passed to ext2 library 
 debugfs -R "stat /l_30" test.img
 Inode: 12   Type: symlink    Mode:  0777   Flags: 0x0
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Project:     0   Size: 31
+User:     0   Group:     0   Project:     0   Size: 30
 File ACL: 0
 Links: 1   Blockcount: 0
 Fragment:  Address: 0    Number: 0    Size: 0
 Size of extra inode fields: 32
-Fast link dest: "/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+Fast link dest: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
 debugfs -R "stat /l_70" test.img
 Inode: 13   Type: symlink    Mode:  0777   Flags: 0x10000000
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Project:     0   Size: 71
+User:     0   Group:     0   Project:     0   Size: 70
 File ACL: 0
 Links: 1   Blockcount: 0
 Fragment:  Address: 0    Number: 0    Size: 0
 Size of extra inode fields: 32
 Extended attributes:
-  system.data (11)
-Fast link dest: "/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+  system.data (10)
+Fast link dest: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
 debugfs -R "stat /l_500" test.img
 Inode: 14   Type: symlink    Mode:  0777   Flags: 0x80000
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Project:     0   Size: 501
+User:     0   Group:     0   Project:     0   Size: 500
 File ACL: 0
 Links: 1   Blockcount: 2
 Fragment:  Address: 0    Number: 0    Size: 0
@@ -49,7 +49,7 @@ EXTENTS:
 debugfs -R "stat /l_1023" test.img
 Inode: 15   Type: symlink    Mode:  0777   Flags: 0x80000
 Generation: 0    Version: 0x00000000:00000000
-User:     0   Group:     0   Project:     0   Size: 1024
+User:     0   Group:     0   Project:     0   Size: 1023
 File ACL: 0
 Links: 1   Blockcount: 2
 Fragment:  Address: 0    Number: 0    Size: 0
diff --git a/tests/f_create_symlinks/script b/tests/f_create_symlinks/script
index 779d92ed..73f95a6e 100644
--- a/tests/f_create_symlinks/script
+++ b/tests/f_create_symlinks/script
@@ -24,8 +24,8 @@ sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
 rm -f $OUT.new
 
 for i in 30 70 500 1023 1024 1500; do
-	echo "debugfs -R \"symlink /l_$i /$(perl -e "print 'x' x $i;")\" test.img" >> $OUT
-	$DEBUGFS -w -R "symlink /l_$i /$(perl -e "print 'x' x $i;")" $TMPFILE \
+	echo "debugfs -R \"symlink /l_$i $(perl -e "print 'x' x $i;")\" test.img" >> $OUT
+	$DEBUGFS -w -R "symlink /l_$i $(perl -e "print 'x' x $i;")" $TMPFILE \
 		 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
 done
 
-- 
2.16.2.395.g2e18187dfd-goog




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux