diff options
author | Theodore Ts'o <tytso@mit.edu> | 2015-05-31 19:35:32 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-05-31 19:35:32 +0200 |
commit | 4d3c4e5b8cae3bb45ba933a22670504239958aa1 (patch) | |
tree | 810780fe18d77d514578323183221ebbc1ced2c3 /fs/ext4/ext4.h | |
parent | ext4 crypto: clean up error handling in ext4_fname_setup_filename (diff) | |
download | linux-4d3c4e5b8cae3bb45ba933a22670504239958aa1.tar.xz linux-4d3c4e5b8cae3bb45ba933a22670504239958aa1.zip |
ext4 crypto: allocate the right amount of memory for the on-disk symlink
Previously we were taking the required padding when allocating space
for the on-disk symlink. This caused a buffer overrun which could
trigger a krenel crash when running fsstress.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index bd8d32d5214d..730c88d1b220 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -2090,6 +2090,7 @@ static inline int ext4_sb_has_crypto(struct super_block *sb) /* crypto_fname.c */ bool ext4_valid_filenames_enc_mode(uint32_t mode); u32 ext4_fname_crypto_round_up(u32 size, u32 blksize); +unsigned ext4_fname_encrypted_size(struct inode *inode, u32 ilen); int ext4_fname_crypto_alloc_buffer(struct inode *inode, u32 ilen, struct ext4_str *crypto_str); int _ext4_fname_disk_to_usr(struct inode *inode, |