diff options
author | Michael Halcrow <mhalcrow@google.com> | 2014-11-26 09:09:16 -0800 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-01-05 18:20:43 +0100 |
commit | b42048862e1bc95465394cc63a93f1a6b1bde4a3 (patch) | |
tree | 81984bc0a1a57b18d8d07049b0334fb86955d09c | |
parent | addc2501adac4b0e1c0d814a5901cdead1bb214a (diff) | |
download | kernel_samsung_tuna-b42048862e1bc95465394cc63a93f1a6b1bde4a3.tar.gz kernel_samsung_tuna-b42048862e1bc95465394cc63a93f1a6b1bde4a3.tar.bz2 kernel_samsung_tuna-b42048862e1bc95465394cc63a93f1a6b1bde4a3.zip |
eCryptfs: Remove buggy and unnecessary write in file name decode routine
Dmitry Chernenkov used KASAN to discover that eCryptfs writes past the
end of the allocated buffer during encrypted filename decoding. This
fix corrects the issue by getting rid of the unnecessary 0 write when
the current bit offset is 2.
Change-Id: Id8e04a580e550495c46cd36fec430a1ec4342940
Signed-off-by: Michael Halcrow <mhalcrow@google.com>
Reported-by: Dmitry Chernenkov <dmitryc@google.com>
Suggested-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org # v2.6.29+: 51ca58d eCryptfs: Filename Encryption: Encoding and encryption functions
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
-rw-r--r-- | fs/ecryptfs/crypto.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index c6602d24517..dcf1fb542af 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -2036,7 +2036,6 @@ ecryptfs_decode_from_filename(unsigned char *dst, size_t *dst_size, break; case 2: dst[dst_byte_offset++] |= (src_byte); - dst[dst_byte_offset] = 0; current_bit_offset = 0; break; } |