[PATCH 02/06] ecryptfs: Validate body size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kernel version: 2.6.17-mm1

The patch ensures that body_size is checked for improper values.

Signed-off-by: Stephan Mueller <[email protected]>

---

 fs/ecryptfs/keystore.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

4d78bed2424c6af4a0d1ef4944d485bd5fd48d36
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index e80d7a6..9b98fac 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -397,6 +397,12 @@ parse_tag_11_packet(unsigned char *data,
 		rc = -EINVAL;
 		goto out;
 	}
+	if (body_size < 13) {
+		ecryptfs_printk(KERN_WARNING, "Invalid body size ([%d])\n",
+				body_size);
+		rc = -EINVAL;
+		goto out;
+	}
 	/* We have 13 bytes of surrounding packet values */
 	(*tag_11_contents_size) = (body_size - 13);
 	if ((*tag_11_contents_size) > max_contents_bytes) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux