EcryptFS development
 help / color / mirror / Atom feed
From: Michael Halcrow <mhalcrow@google.com>
To: tyhicks@canonical.com
Cc: dmitryc@google.com, keescook@google.com,
	ecryptfs@vger.kernel.org, Michael Halcrow <mhalcrow@google.com>
Subject: [PATCH] eCryptfs: Remove buggy and unnecessary write in file name decode routine
Date: Wed, 26 Nov 2014 09:09:16 -0800	[thread overview]
Message-ID: <1417021756-30233-1-git-send-email-mhalcrow@google.com> (raw)

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

             reply	other threads:[~2014-11-26 17:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 17:09 Michael Halcrow [this message]
2014-11-26 17:22 ` [PATCH] eCryptfs: Remove buggy and unnecessary write in file name decode routine Tyler Hicks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1417021756-30233-1-git-send-email-mhalcrow@google.com \
    --to=mhalcrow@google.com \
    --cc=dmitryc@google.com \
    --cc=ecryptfs@vger.kernel.org \
    --cc=keescook@google.com \
    --cc=tyhicks@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox