EcryptFS development
 help / color / mirror / Atom feed
* [PATCH] eCryptfs: Remove buggy and unnecessary write in file name decode routine
@ 2014-11-26 17:09 Michael Halcrow
  2014-11-26 17:22 ` Tyler Hicks
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Halcrow @ 2014-11-26 17:09 UTC (permalink / raw)
  To: tyhicks; +Cc: dmitryc, keescook, ecryptfs, Michael Halcrow

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>
---
 fs/ecryptfs/crypto.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 2f6735d..31b148f 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1917,7 +1917,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;
 		}
-- 
2.2.0.rc0.207.ga3a616c

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-26 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-26 17:09 [PATCH] eCryptfs: Remove buggy and unnecessary write in file name decode routine Michael Halcrow
2014-11-26 17:22 ` Tyler Hicks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox