diff options
author | Eric Sandeen <sandeen@redhat.com> | 2007-12-17 19:19:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-17 22:28:15 -0500 |
commit | 459e216429a04779216b61f0fb61938a459fd1ca (patch) | |
tree | ed21241e197acdc1162a5c1bc3b48c21a33ed40f /fs | |
parent | 60af880339aae440293a0c8e93178fdcb41f8a29 (diff) |
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@redhat.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ecryptfs/keystore.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 263fed88c0ca..f458c1f35565 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -1860,7 +1860,7 @@ ecryptfs_add_global_auth_tok(struct ecryptfs_mount_crypt_stat *mount_crypt_stat, | |||
1860 | struct ecryptfs_global_auth_tok *new_auth_tok; | 1860 | struct ecryptfs_global_auth_tok *new_auth_tok; |
1861 | int rc = 0; | 1861 | int rc = 0; |
1862 | 1862 | ||
1863 | new_auth_tok = kmem_cache_alloc(ecryptfs_global_auth_tok_cache, | 1863 | new_auth_tok = kmem_cache_zalloc(ecryptfs_global_auth_tok_cache, |
1864 | GFP_KERNEL); | 1864 | GFP_KERNEL); |
1865 | if (!new_auth_tok) { | 1865 | if (!new_auth_tok) { |
1866 | rc = -ENOMEM; | 1866 | rc = -ENOMEM; |