* Patch "f2fs crypto: fix corrupted symlink in encrypted case" has been added to the 4.5-stable tree
@ 2016-05-02 21:17 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-05-02 21:17 UTC (permalink / raw)
To: jaegeuk, gregkh; +Cc: stable, stable-commits
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@vger.kernel.org> know about it.
>From c90e09f7fb498f81cd4e8bb6460d3a26ccebeca3 Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Wed, 30 Mar 2016 13:13:16 -0700
Subject: f2fs crypto: fix corrupted symlink in encrypted case
From: Jaegeuk Kim <jaegeuk@kernel.org>
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@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-02 21:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-02 21:17 Patch "f2fs crypto: fix corrupted symlink in encrypted case" has been added to the 4.5-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.