public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stephan Müller" <smueller@chronox.de>
To: linux-kernel@vger.kernel.org, akpm@osdl.org
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Subject: [PATCH 01/06] ecryptfs: Validate minimum header extent size
Date: Tue, 27 Jun 2006 01:46:27 +0200	[thread overview]
Message-ID: <200606270146.27959.smueller@chronox.de> (raw)

Kernel version: 2.6.17-mm1

The encrypted file ecryptfs maintains has in the first page meta data that 
is needed for ecryptfs operation. As the encrypted file is untrusted, 
every bit read of that file must be validated.

The patch ensures that crypt_stat->num_header_extents_at_front is checked 
for improper values.

Signed-off-by: Stephan Mueller <smueller@chronox.de>

---

 fs/ecryptfs/crypto.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

1d76f6b4a787047ca354c8385614b0d549db6bc8
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 427f470..91b350e 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1333,7 +1333,8 @@ static int parse_header_metadata(struct 
 	crypt_stat->num_header_extents_at_front =
 		(int)num_header_extents_at_front;
 	(*bytes_read) = 6;
-	if (crypt_stat->header_extent_size
+	if ((crypt_stat->header_extent_size
+	     * crypt_stat->num_header_extents_at_front)
 	    < ECRYPTFS_MINIMUM_HEADER_EXTENT_SIZE) {
 		rc = -EINVAL;
 		ecryptfs_printk(KERN_WARNING, "Invalid header extent size: "

             reply	other threads:[~2006-06-26 23:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 23:46 Stephan Müller [this message]
2006-06-27 16:17 ` [PATCH 01/06] ecryptfs: Validate minimum header extent size Michael Halcrow

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=200606270146.27959.smueller@chronox.de \
    --to=smueller@chronox.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhalcrow@us.ibm.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