From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:55543 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755025AbcEBVRm (ORCPT ); Mon, 2 May 2016 17:17:42 -0400 Subject: Patch "f2fs crypto: fix corrupted symlink in encrypted case" has been added to the 4.5-stable tree To: jaegeuk@kernel.org, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 02 May 2016 14:17:41 -0700 Message-ID: <14622238610227@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From c90e09f7fb498f81cd4e8bb6460d3a26ccebeca3 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Wed, 30 Mar 2016 13:13:16 -0700 Subject: f2fs crypto: fix corrupted symlink in encrypted case From: Jaegeuk Kim 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 Signed-off-by: Greg Kroah-Hartman --- 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@kernel.org are queue-4.5/f2fs-slightly-reorganize-read_raw_super_block.patch queue-4.5/f2fs-crypto-fix-corrupted-symlink-in-encrypted-case.patch