Make e2fsck start validating that the ciphertext length stored in the
header of an encrypted symlink target, plus the header itself, is no
larger than a filesystem block. Previously e2fsck only verified that
this size is not exactly equal to a filesystem block. This was
sufficient for unencrypted symlinks, where the "actual length" is
computed using strnlen(), but not for encrypted symlinks; the kernel
also considers encrypted symlinks with too-large ciphertext length to be
invalid.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
} else {
len = strnlen(buf, fs->blocksize);
}
- if (len == fs->blocksize)
+ if (len >= fs->blocksize)
return 0;
} else if (inode->i_flags & EXT4_INLINE_DATA_FL) {
char *inline_buf = NULL;