[<prev] [next>] [day] [month] [year] [list]
Message-ID: <475F22C8.5040306@redhat.com>
Date: Tue, 11 Dec 2007 17:52:40 -0600
From: Eric Sandeen <sandeen@...hat.com>
To: linux-kernel Mailing List <linux-kernel@...r.kernel.org>
CC: Andrew Morton <akpm@...l.org>,
Michael Halcrow <mhalcrow@...ibm.com>
Subject: [PATCH] ecryptfs: initialize new auth_tokens before teardown
ecryptfs_destroy_mount_crypt_stat() checks whether each
auth_tok->global_auth_tok_key is nonzero and if so puts that
key. However, in some early mount error paths nothing has initialized
the pointer, and we try to key_put() garbage. Running the bad cipher
tests in the testsuite exposes this, and it's happy with the following
change.
Signed-off-by: Eric Sandeen <sandeen@...hat.com>
---
Index: linux/fs/ecryptfs/keystore.c
===================================================================
--- linux.orig/fs/ecryptfs/keystore.c
+++ linux/fs/ecryptfs/keystore.c
@@ -1851,7 +1851,7 @@ ecryptfs_add_global_auth_tok(struct ecry
struct ecryptfs_global_auth_tok *new_auth_tok;
int rc = 0;
- new_auth_tok = kmem_cache_alloc(ecryptfs_global_auth_tok_cache,
+ new_auth_tok = kmem_cache_zalloc(ecryptfs_global_auth_tok_cache,
GFP_KERNEL);
if (!new_auth_tok) {
rc = -ENOMEM;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists