Skip to contentSkip to conversation

ecryptfs: Use the passed-in max value as the upper bound.

PATCH In review Stephan Müller 1 participant 1 message Jun 26, 2006 Ecrypt file system

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 ecryptfs: Use the passed-in max value as the upper bound.

Kernel version: 2.6.17-mm1

Function encrypted_session_key_set is given a maximum length it is allowed to write. This patch makes this function to obey this length.

---

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

f64944018925812338c59adab29982be8f963386

fs/ecryptfs/keystore.c +1 -1
index efcf00a..4b9b742 100644
@@ -929,7 +929,7 @@ encrypted_session_key_set:
 	/* TODO: Packet size limit */
 	/* We have 5 bytes of surrounding packet data */
 	if ((0x05 + ECRYPTFS_SALT_SIZE
-	     + (*key_rec).enc_key_size) >= PAGE_CACHE_SIZE) {
+	     + (*key_rec).enc_key_size) >= max) {
 		ecryptfs_printk(KERN_ERR, "Authentication token is too "
 				"large\n");
 		rc = -EINVAL;