[lkml]   [2011]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[120/152] fix freeing user_struct in user cache
2.6.36-stable review patch.  If anyone has any objections, please let us know.


From: Hillf Danton <>

commit 4ef9e11d6867f88951e30db910fa015300e31871 upstream.

When racing on adding into user cache, the new allocated from mm slab
is freed without putting user namespace.

Since the user namespace is already operated by getting, putting has
to be issued.

Signed-off-by: Hillf Danton <>
Acked-by: Serge Hallyn <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Greg Kroah-Hartman <>

kernel/user.c | 1 +
1 file changed, 1 insertion(+)

--- a/kernel/user.c
+++ b/kernel/user.c
@@ -157,6 +157,7 @@ struct user_struct *alloc_uid(struct use
up = uid_hash_find(uid, hashent);
if (up) {
+ put_user_ns(ns);
kmem_cache_free(uid_cachep, new);

 \ /
  Last update: 2011-01-06 01:41    [W:0.380 / U:8.988 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site