diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0027-fix-freeing-user_struct-in-user-cache.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap/linus/0027-fix-freeing-user_struct-in-user-cache.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0027-fix-freeing-user_struct-in-user-cache.patch b/extras/recipes-kernel/linux/linux-omap/linus/0027-fix-freeing-user_struct-in-user-cache.patch new file mode 100644 index 00000000..8ddca9c1 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/linus/0027-fix-freeing-user_struct-in-user-cache.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 2bffbb04acdf2e58726ba8192d468f2bda528fdf Mon Sep 17 00:00:00 2001 | ||
2 | From: Hillf Danton <dhillf@gmail.com> | ||
3 | Date: Wed, 29 Dec 2010 21:55:28 +0800 | ||
4 | Subject: [PATCH 27/65] fix freeing user_struct in user cache | ||
5 | |||
6 | When racing on adding into user cache, the new allocated from mm slab | ||
7 | is freed without putting user namespace. | ||
8 | |||
9 | Since the user namespace is already operated by getting, putting has | ||
10 | to be issued. | ||
11 | |||
12 | Signed-off-by: Hillf Danton <dhillf@gmail.com> | ||
13 | Acked-by: Serge Hallyn <serge@hallyn.com> | ||
14 | Cc: stable@kernel.org | ||
15 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
16 | --- | ||
17 | kernel/user.c | 1 + | ||
18 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
19 | |||
20 | diff --git a/kernel/user.c b/kernel/user.c | ||
21 | index 2c7d8d5..5c598ca 100644 | ||
22 | --- a/kernel/user.c | ||
23 | +++ b/kernel/user.c | ||
24 | @@ -158,6 +158,7 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid) | ||
25 | spin_lock_irq(&uidhash_lock); | ||
26 | up = uid_hash_find(uid, hashent); | ||
27 | if (up) { | ||
28 | + put_user_ns(ns); | ||
29 | key_put(new->uid_keyring); | ||
30 | key_put(new->session_keyring); | ||
31 | kmem_cache_free(uid_cachep, new); | ||
32 | -- | ||
33 | 1.6.6.1 | ||
34 | |||