<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/user.c, branch imx-android-r10.4</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>sched: Remove a stale comment</title>
<updated>2010-05-10T06:48:39+00:00</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2010-05-10T03:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=af507ae8a0512a83728b17d8f8c5fa1561669f50'/>
<id>af507ae8a0512a83728b17d8f8c5fa1561669f50</id>
<content type='text'>
This comment should have been removed together with uids_mutex
when removing user sched.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
LKML-Reference: &lt;4BE77C6B.5010402@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This comment should have been removed together with uids_mutex
when removing user sched.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
LKML-Reference: &lt;4BE77C6B.5010402@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched: Remove remaining USER_SCHED code</title>
<updated>2010-04-02T18:12:00+00:00</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2010-03-24T05:17:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=32bd7eb5a7f4596c8440dd9440322fe9e686634d'/>
<id>32bd7eb5a7f4596c8440dd9440322fe9e686634d</id>
<content type='text'>
This is left over from commit 7c9414385e ("sched: Remove USER_SCHED"")

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
LKML-Reference: &lt;4BA9A05F.7010407@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is left over from commit 7c9414385e ("sched: Remove USER_SCHED"")

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
LKML-Reference: &lt;4BA9A05F.7010407@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched: Remove some dead code</title>
<updated>2010-03-16T10:05:44+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-03-15T08:21:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6427462bfa50f50dc6c088c07037264fcc73eca1'/>
<id>6427462bfa50f50dc6c088c07037264fcc73eca1</id>
<content type='text'>
This was left over from "7c9414385e sched: Remove USER_SCHED"

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Acked-by: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
LKML-Reference: &lt;20100315082148.GD18181@bicker&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was left over from "7c9414385e sched: Remove USER_SCHED"

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Acked-by: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
LKML-Reference: &lt;20100315082148.GD18181@bicker&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched: Remove USER_SCHED</title>
<updated>2010-01-21T12:40:18+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval.giani@gmail.com</email>
</author>
<published>2010-01-20T12:26:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7c9414385ebfdd87cc542d4e7e3bb0dbb2d3ce25'/>
<id>7c9414385ebfdd87cc542d4e7e3bb0dbb2d3ce25</id>
<content type='text'>
Remove the USER_SCHED feature. It has been scheduled to be removed in
2.6.34 as per http://marc.info/?l=linux-kernel&amp;m=125728479022976&amp;w=2

Signed-off-by: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;1263990378.24844.3.camel@localhost&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the USER_SCHED feature. It has been scheduled to be removed in
2.6.34 as per http://marc.info/?l=linux-kernel&amp;m=125728479022976&amp;w=2

Signed-off-by: Dhaval Giani &lt;dhaval.giani@gmail.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;1263990378.24844.3.camel@localhost&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uids: Prevent tear down race</title>
<updated>2009-11-02T15:02:39+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-11-02T12:01:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b00bc0b237055b4c45816325ee14f0bd83e6f590'/>
<id>b00bc0b237055b4c45816325ee14f0bd83e6f590</id>
<content type='text'>
Ingo triggered the following warning:

WARNING: at lib/debugobjects.c:255 debug_print_object+0x42/0x50()
Hardware name: System Product Name
ODEBUG: init active object type: timer_list
Modules linked in:
Pid: 2619, comm: dmesg Tainted: G        W  2.6.32-rc5-tip+ #5298
Call Trace:
 [&lt;81035443&gt;] warn_slowpath_common+0x6a/0x81
 [&lt;8120e483&gt;] ? debug_print_object+0x42/0x50
 [&lt;81035498&gt;] warn_slowpath_fmt+0x29/0x2c
 [&lt;8120e483&gt;] debug_print_object+0x42/0x50
 [&lt;8120ec2a&gt;] __debug_object_init+0x279/0x2d7
 [&lt;8120ecb3&gt;] debug_object_init+0x13/0x18
 [&lt;810409d2&gt;] init_timer_key+0x17/0x6f
 [&lt;81041526&gt;] free_uid+0x50/0x6c
 [&lt;8104ed2d&gt;] put_cred_rcu+0x61/0x72
 [&lt;81067fac&gt;] rcu_do_batch+0x70/0x121

debugobjects warns about an enqueued timer being initialized. If
CONFIG_USER_SCHED=y the user management code uses delayed work to
remove the user from the hash table and tear down the sysfs objects.

free_uid is called from RCU and initializes/schedules delayed work if
the usage count of the user_struct is 0. The init/schedule happens
outside of the uidhash_lock protected region which allows a concurrent
caller of find_user() to reference the about to be destroyed
user_struct w/o preventing the work from being scheduled. If the next
free_uid call happens before the work timer expired then the active
timer is initialized and the work scheduled again.

The race was introduced in commit 5cb350ba (sched: group scheduling,
sysfs tunables) and made more prominent by commit 3959214f (sched:
delayed cleanup of user_struct)

Move the init/schedule_delayed_work inside of the uidhash_lock
protected region to prevent the race.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Cc: Paul E. McKenney &lt;paulmck@us.ibm.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: stable@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ingo triggered the following warning:

WARNING: at lib/debugobjects.c:255 debug_print_object+0x42/0x50()
Hardware name: System Product Name
ODEBUG: init active object type: timer_list
Modules linked in:
Pid: 2619, comm: dmesg Tainted: G        W  2.6.32-rc5-tip+ #5298
Call Trace:
 [&lt;81035443&gt;] warn_slowpath_common+0x6a/0x81
 [&lt;8120e483&gt;] ? debug_print_object+0x42/0x50
 [&lt;81035498&gt;] warn_slowpath_fmt+0x29/0x2c
 [&lt;8120e483&gt;] debug_print_object+0x42/0x50
 [&lt;8120ec2a&gt;] __debug_object_init+0x279/0x2d7
 [&lt;8120ecb3&gt;] debug_object_init+0x13/0x18
 [&lt;810409d2&gt;] init_timer_key+0x17/0x6f
 [&lt;81041526&gt;] free_uid+0x50/0x6c
 [&lt;8104ed2d&gt;] put_cred_rcu+0x61/0x72
 [&lt;81067fac&gt;] rcu_do_batch+0x70/0x121

debugobjects warns about an enqueued timer being initialized. If
CONFIG_USER_SCHED=y the user management code uses delayed work to
remove the user from the hash table and tear down the sysfs objects.

free_uid is called from RCU and initializes/schedules delayed work if
the usage count of the user_struct is 0. The init/schedule happens
outside of the uidhash_lock protected region which allows a concurrent
caller of find_user() to reference the about to be destroyed
user_struct w/o preventing the work from being scheduled. If the next
free_uid call happens before the work timer expired then the active
timer is initialized and the work scheduled again.

The race was introduced in commit 5cb350ba (sched: group scheduling,
sysfs tunables) and made more prominent by commit 3959214f (sched:
delayed cleanup of user_struct)

Move the init/schedule_delayed_work inside of the uidhash_lock
protected region to prevent the race.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Cc: Paul E. McKenney &lt;paulmck@us.ibm.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: stable@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>sched: delayed cleanup of user_struct</title>
<updated>2009-06-16T04:30:23+00:00</updated>
<author>
<name>Kay Sievers</name>
<email>kay.sievers@vrfy.org</email>
</author>
<published>2009-03-24T14:43:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3959214f971417f4162926ac52ad4cd042958caa'/>
<id>3959214f971417f4162926ac52ad4cd042958caa</id>
<content type='text'>
During bootup performance tracing we see repeated occurrences of
/sys/kernel/uid/* events for the same uid, leading to a,
in this case, rather pointless userspace processing for the
same uid over and over.

This is usually caused by tools which change their uid to "nobody",
to run without privileges to read data supplied by untrusted users.

This change delays the execution of the (already existing) scheduled
work, to cleanup the uid after one second, so the allocated and announced
uid can possibly be re-used by another process.

This is the current behavior, where almost every invocation of a
binary, which changes the uid, creates two events:
  $ read START &lt; /sys/kernel/uevent_seqnum; \
  for i in `seq 100`; do su --shell=/bin/true bin; done; \
  read END &lt; /sys/kernel/uevent_seqnum; \
  echo $(($END - $START))
  178

With the delayed cleanup, we get only two events, and userspace finishes
a bit faster too:
  $ read START &lt; /sys/kernel/uevent_seqnum; \
  for i in `seq 100`; do su --shell=/bin/true bin; done; \
  read END &lt; /sys/kernel/uevent_seqnum; \
  echo $(($END - $START))
  1

Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During bootup performance tracing we see repeated occurrences of
/sys/kernel/uid/* events for the same uid, leading to a,
in this case, rather pointless userspace processing for the
same uid over and over.

This is usually caused by tools which change their uid to "nobody",
to run without privileges to read data supplied by untrusted users.

This change delays the execution of the (already existing) scheduled
work, to cleanup the uid after one second, so the allocated and announced
uid can possibly be re-used by another process.

This is the current behavior, where almost every invocation of a
binary, which changes the uid, creates two events:
  $ read START &lt; /sys/kernel/uevent_seqnum; \
  for i in `seq 100`; do su --shell=/bin/true bin; done; \
  read END &lt; /sys/kernel/uevent_seqnum; \
  echo $(($END - $START))
  178

With the delayed cleanup, we get only two events, and userspace finishes
a bit faster too:
  $ read START &lt; /sys/kernel/uevent_seqnum; \
  for i in `seq 100`; do su --shell=/bin/true bin; done; \
  read END &lt; /sys/kernel/uevent_seqnum; \
  echo $(($END - $START))
  1

Acked-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Signed-off-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' into next</title>
<updated>2009-03-23T23:52:46+00:00</updated>
<author>
<name>James Morris</name>
<email>jmorris@namei.org</email>
</author>
<published>2009-03-23T23:52:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=703a3cd72817e99201cef84a8a7aecc60b2b3581'/>
<id>703a3cd72817e99201cef84a8a7aecc60b2b3581</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel/user.c: fix a memory leak when freeing up non-init usernamespaces users</title>
<updated>2009-03-10T22:55:11+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-03-10T19:55:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=be50b8342dead8cacf57d4839240106b225d31f5'/>
<id>be50b8342dead8cacf57d4839240106b225d31f5</id>
<content type='text'>
We were returning early in the sysfs directory cleanup function if the
user belonged to a non init usernamespace.  Due to this a lot of the
cleanup was not done and we were left with a leak.  Fix the leak.

Reported-by: Serge Hallyn &lt;serue@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Tested-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were returning early in the sysfs directory cleanup function if the
user belonged to a non init usernamespace.  Due to this a lot of the
cleanup was not done and we were left with a leak.  Fix the leak.

Reported-by: Serge Hallyn &lt;serue@linux.vnet.ibm.com&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Tested-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched: don't allow setuid to succeed if the user does not have rt bandwidth</title>
<updated>2009-02-27T10:11:53+00:00</updated>
<author>
<name>Dhaval Giani</name>
<email>dhaval@linux.vnet.ibm.com</email>
</author>
<published>2009-02-27T09:43:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=54e991242850edc8c53f71fa5aa3ba7a93ce38f5'/>
<id>54e991242850edc8c53f71fa5aa3ba7a93ce38f5</id>
<content type='text'>
Impact: fix hung task with certain (non-default) rt-limit settings

Corey Hickey reported that on using setuid to change the uid of a
rt process, the process would be unkillable and not be running.
This is because there was no rt runtime for that user group. Add
in a check to see if a user can attach an rt task to its task group.
On failure, return EINVAL, which is also returned in
CONFIG_CGROUP_SCHED.

Reported-by: Corey Hickey &lt;bugfood-ml@fatooh.org&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: fix hung task with certain (non-default) rt-limit settings

Corey Hickey reported that on using setuid to change the uid of a
rt process, the process would be unkillable and not be running.
This is because there was no rt runtime for that user group. Add
in a check to see if a user can attach an rt task to its task group.
On failure, return EINVAL, which is also returned in
CONFIG_CGROUP_SCHED.

Reported-by: Corey Hickey &lt;bugfood-ml@fatooh.org&gt;
Signed-off-by: Dhaval Giani &lt;dhaval@linux.vnet.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>keys: distinguish per-uid keys in different namespaces</title>
<updated>2009-02-27T01:35:06+00:00</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serue@us.ibm.com</email>
</author>
<published>2009-02-27T00:27:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1d1e97562e5e2ac60fb7b25437ba619f95f67fab'/>
<id>1d1e97562e5e2ac60fb7b25437ba619f95f67fab</id>
<content type='text'>
per-uid keys were looked by uid only.  Use the user namespace
to distinguish the same uid in different namespaces.

This does not address key_permission.  So a task can for instance
try to join a keyring owned by the same uid in another namespace.
That will be handled by a separate patch.

Signed-off-by: Serge E. Hallyn &lt;serue@us.ibm.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
per-uid keys were looked by uid only.  Use the user namespace
to distinguish the same uid in different namespaces.

This does not address key_permission.  So a task can for instance
try to join a keyring owned by the same uid in another namespace.
That will be handled by a separate patch.

Signed-off-by: Serge E. Hallyn &lt;serue@us.ibm.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
