* [PATCH] fix freeing user_struct in user cache
@ 2010-12-23 12:52 Hillf Danton
2010-12-24 3:55 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Hillf Danton @ 2010-12-23 12:52 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman
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.
btw, it could be freed out of lock?
Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
--- a/kernel/user.c 2010-11-01 19:54:12.000000000 +0800
+++ b/kernel/user.c 2010-12-23 20:42:00.000000000 +0800
@@ -158,6 +158,7 @@ struct user_struct *alloc_uid(struct use
spin_lock_irq(&uidhash_lock);
up = uid_hash_find(uid, hashent);
if (up) {
+ put_user_ns(ns);
key_put(new->uid_keyring);
key_put(new->session_keyring);
kmem_cache_free(uid_cachep, new);
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] fix freeing user_struct in user cache 2010-12-23 12:52 [PATCH] fix freeing user_struct in user cache Hillf Danton @ 2010-12-24 3:55 ` Greg KH 2010-12-24 14:24 ` Hillf Danton 0 siblings, 1 reply; 8+ messages in thread From: Greg KH @ 2010-12-24 3:55 UTC (permalink / raw) To: Hillf Danton; +Cc: linux-kernel On Thu, Dec 23, 2010 at 08:52:34PM +0800, Hillf Danton wrote: > 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. > > btw, it could be freed out of lock? > > Signed-off-by: Hillf Danton <dhillf@gmail.com> > --- > > --- a/kernel/user.c 2010-11-01 19:54:12.000000000 +0800 > +++ b/kernel/user.c 2010-12-23 20:42:00.000000000 +0800 > @@ -158,6 +158,7 @@ struct user_struct *alloc_uid(struct use > spin_lock_irq(&uidhash_lock); > up = uid_hash_find(uid, hashent); > if (up) { > + put_user_ns(ns); > key_put(new->uid_keyring); > key_put(new->session_keyring); > kmem_cache_free(uid_cachep, new); Hm, are you sure about this? Also, why send this to me, did I last touch this? confused, greg k-h ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix freeing user_struct in user cache 2010-12-24 3:55 ` Greg KH @ 2010-12-24 14:24 ` Hillf Danton 2010-12-24 17:14 ` Greg KH 2010-12-24 23:56 ` Serge E. Hallyn 0 siblings, 2 replies; 8+ messages in thread From: Hillf Danton @ 2010-12-24 14:24 UTC (permalink / raw) To: Greg KH; +Cc: linux-kernel On Fri, Dec 24, 2010 at 11:55 AM, Greg KH <gregkh@suse.de> wrote: > On Thu, Dec 23, 2010 at 08:52:34PM +0800, Hillf Danton wrote: >> 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. >> >> btw, it could be freed out of lock? >> >> Signed-off-by: Hillf Danton <dhillf@gmail.com> >> --- >> >> --- a/kernel/user.c 2010-11-01 19:54:12.000000000 +0800 >> +++ b/kernel/user.c 2010-12-23 20:42:00.000000000 +0800 >> @@ -158,6 +158,7 @@ struct user_struct *alloc_uid(struct use >> spin_lock_irq(&uidhash_lock); >> up = uid_hash_find(uid, hashent); >> if (up) { >> + put_user_ns(ns); >> key_put(new->uid_keyring); >> key_put(new->session_keyring); >> kmem_cache_free(uid_cachep, new); > > Hm, are you sure about this? Also, why send this to me, did I last > touch this? > sure with no doubt. I do not know if you touched that last, but I received the following message, On Tue, Dec 21, 2010 at 3:42 AM, <gregkh@suse.de> wrote: > > This is a note to let you know that I've just added the patch titled > > bonding: Fix slave selection bug. > > to the 2.6.36-stable tree which can be found at: > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary so you were Cced since you charge patch delivered. Cheers Hillf > confused, > > greg k-h > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix freeing user_struct in user cache 2010-12-24 14:24 ` Hillf Danton @ 2010-12-24 17:14 ` Greg KH 2010-12-25 13:56 ` Hillf Danton 2010-12-24 23:56 ` Serge E. Hallyn 1 sibling, 1 reply; 8+ messages in thread From: Greg KH @ 2010-12-24 17:14 UTC (permalink / raw) To: Hillf Danton; +Cc: linux-kernel On Fri, Dec 24, 2010 at 10:24:02PM +0800, Hillf Danton wrote: > On Fri, Dec 24, 2010 at 11:55 AM, Greg KH <gregkh@suse.de> wrote: > > On Thu, Dec 23, 2010 at 08:52:34PM +0800, Hillf Danton wrote: > >> 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. > >> > >> btw, it could be freed out of lock? > >> > >> Signed-off-by: Hillf Danton <dhillf@gmail.com> > >> --- > >> > >> --- a/kernel/user.c 2010-11-01 19:54:12.000000000 +0800 > >> +++ b/kernel/user.c 2010-12-23 20:42:00.000000000 +0800 > >> @@ -158,6 +158,7 @@ struct user_struct *alloc_uid(struct use > >> spin_lock_irq(&uidhash_lock); > >> up = uid_hash_find(uid, hashent); > >> if (up) { > >> + put_user_ns(ns); > >> key_put(new->uid_keyring); > >> key_put(new->session_keyring); > >> kmem_cache_free(uid_cachep, new); > > > > Hm, are you sure about this? Also, why send this to me, did I last > > touch this? > > > > sure with no doubt. > > I do not know if you touched that last, but I received the following message, > > On Tue, Dec 21, 2010 at 3:42 AM, <gregkh@suse.de> wrote: > > > > This is a note to let you know that I've just added the patch titled > > > > bonding: Fix slave selection bug. > > > > to the 2.6.36-stable tree which can be found at: > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary > > so you were Cced since you charge patch delivered. That was a stable patch, I send all of those out :) Use scripts/get_maintainer.pl to determine the best person to send this patch to (hint, it's not me.) thanks, greg k-h ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix freeing user_struct in user cache 2010-12-24 17:14 ` Greg KH @ 2010-12-25 13:56 ` Hillf Danton [not found] ` <20101229030936.GA9275@mail.hallyn.com> 0 siblings, 1 reply; 8+ messages in thread From: Hillf Danton @ 2010-12-25 13:56 UTC (permalink / raw) To: Greg KH; +Cc: linux-kernel On Sat, Dec 25, 2010 at 1:14 AM, Greg KH <gregkh@suse.de> wrote: > That was a stable patch, I send all of those out :) > > Use scripts/get_maintainer.pl to determine the best person to send this > patch to (hint, it's not me.) thanks, Greg, for sending it out, and merry Christmas. Hillf > > thanks, > > greg k-h > ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20101229030936.GA9275@mail.hallyn.com>]
* [PATCH] fix freeing user_struct in user cache [not found] ` <20101229030936.GA9275@mail.hallyn.com> @ 2010-12-29 13:55 ` Hillf Danton 2010-12-31 14:25 ` Serge E. Hallyn 0 siblings, 1 reply; 8+ messages in thread From: Hillf Danton @ 2010-12-29 13:55 UTC (permalink / raw) To: linux-kernel; +Cc: Serge E. Hallyn, Linus Torvalds, stable 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 <dhillf@gmail.com> --- --- a/kernel/user.c 2010-11-01 19:54:12.000000000 +0800 +++ b/kernel/user.c 2010-12-23 20:42:00.000000000 +0800 @@ -158,6 +158,7 @@ struct user_struct *alloc_uid(struct use spin_lock_irq(&uidhash_lock); up = uid_hash_find(uid, hashent); if (up) { + put_user_ns(ns); key_put(new->uid_keyring); key_put(new->session_keyring); kmem_cache_free(uid_cachep, new); ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix freeing user_struct in user cache 2010-12-29 13:55 ` Hillf Danton @ 2010-12-31 14:25 ` Serge E. Hallyn 0 siblings, 0 replies; 8+ messages in thread From: Serge E. Hallyn @ 2010-12-31 14:25 UTC (permalink / raw) To: Hillf Danton; +Cc: linux-kernel, Serge E. Hallyn, Linus Torvalds, stable Quoting Hillf Danton (dhillf@gmail.com): > 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 <dhillf@gmail.com> which was previously > Acked-by: Serge Hallyn <serge@hallyn.com> thanks again, Hillf. > --- > > --- a/kernel/user.c 2010-11-01 19:54:12.000000000 +0800 > +++ b/kernel/user.c 2010-12-23 20:42:00.000000000 +0800 > @@ -158,6 +158,7 @@ struct user_struct *alloc_uid(struct use > spin_lock_irq(&uidhash_lock); > up = uid_hash_find(uid, hashent); > if (up) { > + put_user_ns(ns); > key_put(new->uid_keyring); > key_put(new->session_keyring); > kmem_cache_free(uid_cachep, new); ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix freeing user_struct in user cache 2010-12-24 14:24 ` Hillf Danton 2010-12-24 17:14 ` Greg KH @ 2010-12-24 23:56 ` Serge E. Hallyn 1 sibling, 0 replies; 8+ messages in thread From: Serge E. Hallyn @ 2010-12-24 23:56 UTC (permalink / raw) To: Hillf Danton; +Cc: Greg KH, linux-kernel Quoting Hillf Danton (dhillf@gmail.com): > On Fri, Dec 24, 2010 at 11:55 AM, Greg KH <gregkh@suse.de> wrote: > > On Thu, Dec 23, 2010 at 08:52:34PM +0800, Hillf Danton wrote: > >> 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. > >> > >> btw, it could be freed out of lock? > >> > >> Signed-off-by: Hillf Danton <dhillf@gmail.com> > >> --- > >> > >> --- a/kernel/user.c 2010-11-01 19:54:12.000000000 +0800 > >> +++ b/kernel/user.c 2010-12-23 20:42:00.000000000 +0800 > >> @@ -158,6 +158,7 @@ struct user_struct *alloc_uid(struct use > >> spin_lock_irq(&uidhash_lock); > >> up = uid_hash_find(uid, hashent); > >> if (up) { > >> + put_user_ns(ns); > >> key_put(new->uid_keyring); > >> key_put(new->session_keyring); > >> kmem_cache_free(uid_cachep, new); > > > > Hm, are you sure about this? Also, why send this to me, did I last > > touch this? > > > > sure with no doubt. Good catch, thanks. Acked-by: Serge Hallyn <serge@hallyn.com> > I do not know if you touched that last, but I received the following message, thanks, -serge ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-12-31 14:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-23 12:52 [PATCH] fix freeing user_struct in user cache Hillf Danton
2010-12-24 3:55 ` Greg KH
2010-12-24 14:24 ` Hillf Danton
2010-12-24 17:14 ` Greg KH
2010-12-25 13:56 ` Hillf Danton
[not found] ` <20101229030936.GA9275@mail.hallyn.com>
2010-12-29 13:55 ` Hillf Danton
2010-12-31 14:25 ` Serge E. Hallyn
2010-12-24 23:56 ` Serge E. Hallyn
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox