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>
---
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;
--
| monstr | [PATCH 27/56] microblaze_v2: support for a.out |
| Andrew Morton | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| mdew . | Re: [patch] CFS scheduler, v4 |
| Gabriel C | Re: 2.6.21-mm1 |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Willy Tarreau | Re: [PATCH] tcp: splice as many packets as possible at once |
| Linus Torvalds | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
