Skip to content

Commit 9420806

Browse files
mhalcrow-googletyhicks
authored andcommitted
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. 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>
1 parent 831115a commit 9420806

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Diff for: fs/ecryptfs/crypto.c

-1
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,6 @@ ecryptfs_decode_from_filename(unsigned char *dst, size_t *dst_size,
19171917
break;
19181918
case 2:
19191919
dst[dst_byte_offset++] |= (src_byte);
1920-
dst[dst_byte_offset] = 0;
19211920
current_bit_offset = 0;
19221921
break;
19231922
}

0 commit comments

Comments
 (0)