<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/sys.c, branch v2.6.38</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.38</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.38'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2011-01-31T03:01:27Z</updated>
<entry>
<title>Fix prlimit64 for suid/sgid processes</title>
<updated>2011-01-31T03:01:27Z</updated>
<author>
<name>Kacper Kornet</name>
<email>kornet@camk.edu.pl</email>
</author>
<published>2011-01-28T23:21:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa5bd67dcfdf9af34c7fa36ebc87d4e1f7e91873'/>
<id>urn:sha1:aa5bd67dcfdf9af34c7fa36ebc87d4e1f7e91873</id>
<content type='text'>
Since check_prlimit_permission always fails in the case of SUID/GUID
processes, such processes are not able to read or set their own limits.
This commit changes this by assuming that process can always read/change
its own limits.

Signed-off-by: Kacper Kornet &lt;kornet@camk.edu.pl&gt;
Acked-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kmsg_dump: add kmsg_dump() calls to the reboot, halt, poweroff and emergency_restart paths</title>
<updated>2011-01-13T16:03:07Z</updated>
<author>
<name>Seiji Aguchi</name>
<email>seiji.aguchi@hds.com</email>
</author>
<published>2011-01-13T00:59:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=04c6862c055fb687c90d9652f32c11a063df15cf'/>
<id>urn:sha1:04c6862c055fb687c90d9652f32c11a063df15cf</id>
<content type='text'>
We need to know the reason why system rebooted in support service.
However, we can't inform our customers of the reason because final
messages are lost on current Linux kernel.

This patch improves the situation above because the final messages are
saved by adding kmsg_dump() to reboot, halt, poweroff and
emergency_restart path.

Signed-off-by: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Marco Stornelli &lt;marco.stornelli@gmail.com&gt;
Reviewed-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
Reviewed-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.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>
</entry>
<entry>
<title>sched: Add 'autogroup' scheduling feature: automated per session task groups</title>
<updated>2010-11-30T15:03:35Z</updated>
<author>
<name>Mike Galbraith</name>
<email>efault@gmx.de</email>
</author>
<published>2010-11-30T13:18:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5091faa449ee0b7d73bc296a93bca9540fc51d0a'/>
<id>urn:sha1:5091faa449ee0b7d73bc296a93bca9540fc51d0a</id>
<content type='text'>
A recurring complaint from CFS users is that parallel kbuild has
a negative impact on desktop interactivity.  This patch
implements an idea from Linus, to automatically create task
groups.  Currently, only per session autogroups are implemented,
but the patch leaves the way open for enhancement.

Implementation: each task's signal struct contains an inherited
pointer to a refcounted autogroup struct containing a task group
pointer, the default for all tasks pointing to the
init_task_group.  When a task calls setsid(), a new task group
is created, the process is moved into the new task group, and a
reference to the preveious task group is dropped.  Child
processes inherit this task group thereafter, and increase it's
refcount.  When the last thread of a process exits, the
process's reference is dropped, such that when the last process
referencing an autogroup exits, the autogroup is destroyed.

At runqueue selection time, IFF a task has no cgroup assignment,
its current autogroup is used.

Autogroup bandwidth is controllable via setting it's nice level
through the proc filesystem:

  cat /proc/&lt;pid&gt;/autogroup

Displays the task's group and the group's nice level.

  echo &lt;nice level&gt; &gt; /proc/&lt;pid&gt;/autogroup

Sets the task group's shares to the weight of nice &lt;level&gt; task.
Setting nice level is rate limited for !admin users due to the
abuse risk of task group locking.

The feature is enabled from boot by default if
CONFIG_SCHED_AUTOGROUP=y is selected, but can be disabled via
the boot option noautogroup, and can also be turned on/off on
the fly via:

  echo [01] &gt; /proc/sys/kernel/sched_autogroup_enabled

... which will automatically move tasks to/from the root task group.

Signed-off-by: Mike Galbraith &lt;efault@gmx.de&gt;
Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Markus Trippelsdorf &lt;markus@trippelsdorf.de&gt;
Cc: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Cc: Paul Turner &lt;pjt@google.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
[ Removed the task_group_path() debug code, and fixed !EVENTFD build failure. ]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
LKML-Reference: &lt;1290281700.28711.9.camel@maggy.simson.net&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>pid: make setpgid() system call use RCU read-side critical section</title>
<updated>2010-09-01T00:00:18Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2010-09-01T00:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=950eaaca681c44aab87a46225c9e44f902c080aa'/>
<id>urn:sha1:950eaaca681c44aab87a46225c9e44f902c080aa</id>
<content type='text'>
[   23.584719]
[   23.584720] ===================================================
[   23.585059] [ INFO: suspicious rcu_dereference_check() usage. ]
[   23.585176] ---------------------------------------------------
[   23.585176] kernel/pid.c:419 invoked rcu_dereference_check() without protection!
[   23.585176]
[   23.585176] other info that might help us debug this:
[   23.585176]
[   23.585176]
[   23.585176] rcu_scheduler_active = 1, debug_locks = 1
[   23.585176] 1 lock held by rc.sysinit/728:
[   23.585176]  #0:  (tasklist_lock){.+.+..}, at: [&lt;ffffffff8104771f&gt;] sys_setpgid+0x5f/0x193
[   23.585176]
[   23.585176] stack backtrace:
[   23.585176] Pid: 728, comm: rc.sysinit Not tainted 2.6.36-rc2 #2
[   23.585176] Call Trace:
[   23.585176]  [&lt;ffffffff8105b436&gt;] lockdep_rcu_dereference+0x99/0xa2
[   23.585176]  [&lt;ffffffff8104c324&gt;] find_task_by_pid_ns+0x50/0x6a
[   23.585176]  [&lt;ffffffff8104c35b&gt;] find_task_by_vpid+0x1d/0x1f
[   23.585176]  [&lt;ffffffff81047727&gt;] sys_setpgid+0x67/0x193
[   23.585176]  [&lt;ffffffff810029eb&gt;] system_call_fastpath+0x16/0x1b
[   24.959669] type=1400 audit(1282938522.956:4): avc:  denied  { module_request } for  pid=766 comm="hwclock" kmod="char-major-10-135" scontext=system_u:system_r:hwclock_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclas

It turns out that the setpgid() system call fails to enter an RCU
read-side critical section before doing a PID-to-task_struct translation.
This commit therefore does rcu_read_lock() before the translation, and
also does rcu_read_unlock() after the last use of the returned pointer.

Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>rlimits: implement prlimit64 syscall</title>
<updated>2010-07-16T07:48:48Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2010-05-04T16:03:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c022a0acad534fd5f5d5f17280f6d4d135e74e81'/>
<id>urn:sha1:c022a0acad534fd5f5d5f17280f6d4d135e74e81</id>
<content type='text'>
This patch adds the code to support the sys_prlimit64 syscall which
modifies-and-returns the rlim values of a selected process atomically.
The first parameter, pid, being 0 means current process.

Unlike the current implementation, it is a generic interface,
architecture indepentent so that we needn't handle compat stuff
anymore. In the future, after glibc start to use this we can deprecate
sys_setrlimit and sys_getrlimit in favor to clean up the code finally.

It also adds a possibility of changing limits of other processes. We
check the user's permissions to do that and if it succeeds, the new
limits are propagated online. This is good for large scale
applications such as SAP or databases where administrators need to
change limits time by time (e.g. on crashes increase core size). And
it is unacceptable to restart the service.

For safety, all rlim users now either use accessors or doesn't need
them due to
- locking
- the fact a process was just forked and nobody else knows about it
  yet (and nobody can't thus read/write limits)
hence it is safe to modify limits now.

The limitation is that we currently stay at ulong internal
representation. So the rlim64_is_infinity check is used where value is
compared against ULONG_MAX on 32-bit which is the maximum value there.

And since internally the limits are held in struct rlimit, converters
which are used before and after do_prlimit call in sys_prlimit64 are
introduced.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>rlimits: switch more rlimit syscalls to do_prlimit</title>
<updated>2010-07-16T07:48:48Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jirislaby@gmail.com</email>
</author>
<published>2010-05-04T09:28:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b95183453af2ed14a5c7027e58049c9fd17e92ce'/>
<id>urn:sha1:b95183453af2ed14a5c7027e58049c9fd17e92ce</id>
<content type='text'>
After we added more generic do_prlimit, switch sys_getrlimit to that.
Also switch compat handling, so we can get rid of ugly __user casts
and avoid setting process' address limit to kernel data and back.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>rlimits: redo do_setrlimit to more generic do_prlimit</title>
<updated>2010-07-16T07:48:48Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2010-03-24T15:11:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5b41535aac0c07135ff6a4c5c2ae115d1c20c0bc'/>
<id>urn:sha1:5b41535aac0c07135ff6a4c5c2ae115d1c20c0bc</id>
<content type='text'>
It now allows also reading of limits. I.e. all read and writes will
later use this function.

It takes two parameters, new and old limits which can be both NULL.
If new is non-NULL, the value in it is set to rlimits.
If old is non-NULL, current rlimits are stored there.
If both are non-NULL, old are stored prior to setting the new ones,
atomically.
(Similar to sigaction.)

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>rlimits: do security check under task_lock</title>
<updated>2010-07-16T07:48:47Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2009-11-14T16:37:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=86f162f4c75ceb6daf43165469eeeca1bc3d4639'/>
<id>urn:sha1:86f162f4c75ceb6daf43165469eeeca1bc3d4639</id>
<content type='text'>
Do security_task_setrlimit under task_lock. Other tasks may change
limits under our hands while we are checking limits inside the
function. From now on, they can't.

Note that all the security work is done under a spinlock here now.
Security hooks count with that, they are called from interrupt context
(like security_task_kill) and with spinlocks already held (e.g.
capable-&gt;security_capable).

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>rlimits: allow setrlimit to non-current tasks</title>
<updated>2010-07-16T07:48:47Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jirislaby@gmail.com</email>
</author>
<published>2009-08-28T12:08:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1c1e618ddd15f69fd87ccea596769f78c8065504'/>
<id>urn:sha1:1c1e618ddd15f69fd87ccea596769f78c8065504</id>
<content type='text'>
Add locking to allow setrlimit accept task parameter other than
current.

Namely, lock tasklist_lock for read and check whether the task
structure has sighand non-null. Do all the signal processing under
that lock still held.

There are some points:
1) security_task_setrlimit is now called with that lock held. This is
   not new, many security_* functions are called with this lock held
   already so it doesn't harm (all this security_* stuff does almost
   the same).
2) task-&gt;sighand-&gt;siglock (in update_rlimit_cpu) is nested in
   tasklist_lock. This dependence is already existing.
3) tsk-&gt;alloc_lock is nested in tasklist_lock. This is OK too, already
   existing dependence.

Signed-off-by: Jiri Slaby &lt;jirislaby@gmail.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
</content>
</entry>
<entry>
<title>rlimits: split sys_setrlimit</title>
<updated>2010-07-16T07:48:46Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jirislaby@gmail.com</email>
</author>
<published>2009-08-26T21:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7855c35da7ba16b389d17710401c4a55a3ea2102'/>
<id>urn:sha1:7855c35da7ba16b389d17710401c4a55a3ea2102</id>
<content type='text'>
Create do_setrlimit from sys_setrlimit and declare do_setrlimit
in the resource header. This is the first phase to have generic
do_prlimit which allows to be called from read, write and compat
rlimits code.

The new do_setrlimit also accepts a task pointer to change the limits
of. Currently, it cannot be other than current, but this will change
with locking later.

Also pass tsk-&gt;group_leader to security_task_setrlimit to check
whether current is allowed to change rlimits of the process and not
its arbitrary thread because it makes more sense given that rlimit are
per process and not per-thread.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
</feed>
