This is a note to let you know that I've just added the patch titled f2fs crypto: fix corrupted symlink in encrypted case to the 4.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: f2fs-crypto-fix-corrupted-symlink-in-encrypted-case.patch and it can be found in the queue-4.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From c90e09f7fb498f81cd4e8bb6460d3a26ccebeca3 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> Date: Wed, 30 Mar 2016 13:13:16 -0700 Subject: f2fs crypto: fix corrupted symlink in encrypted case From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> commit c90e09f7fb498f81cd4e8bb6460d3a26ccebeca3 upstream. In the encrypted symlink case, we should check its corrupted symname after decrypting it. Otherwise, we can report -ENOENT incorrectly, if encrypted symname starts with '\0'. Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/f2fs/namei.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -980,12 +980,6 @@ static const char *f2fs_encrypted_get_li } memcpy(cstr.name, sd->encrypted_path, cstr.len); - /* this is broken symlink case */ - if (unlikely(cstr.name[0] == 0)) { - res = -ENOENT; - goto errout; - } - if ((cstr.len + sizeof(struct f2fs_encrypted_symlink_data) - 1) > max_size) { /* Symlink data on the disk is corrupted */ @@ -1002,6 +996,12 @@ static const char *f2fs_encrypted_get_li kfree(cstr.name); + /* this is broken symlink case */ + if (unlikely(pstr.name[0] == 0)) { + res = -ENOENT; + goto errout; + } + paddr = pstr.name; /* Null-terminate the name */ Patches currently in stable-queue which might be from jaegeuk@xxxxxxxxxx are queue-4.5/f2fs-slightly-reorganize-read_raw_super_block.patch queue-4.5/f2fs-crypto-fix-corrupted-symlink-in-encrypted-case.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html