<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/proc/array.c, branch v3.6</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=v3.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-06-01T00:49:32Z</updated>
<entry>
<title>c/r: procfs: add arg_start/end, env_start/end and exit_code members to /proc/$pid/stat</title>
<updated>2012-06-01T00:49:32Z</updated>
<author>
<name>Cyrill Gorcunov</name>
<email>gorcunov@openvz.org</email>
</author>
<published>2012-05-31T23:26:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5b172087f99189416d5f47fd7ab5e6fb762a9ba3'/>
<id>urn:sha1:5b172087f99189416d5f47fd7ab5e6fb762a9ba3</id>
<content type='text'>
We would like to have an ability to restore command line arguments and
program environment pointers but first we need to obtain them somehow.
Thus we put these values into /proc/$pid/stat.  The exit_code is needed to
restore zombie tasks.

Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Andrew Vagin &lt;avagin@openvz.org&gt;
Cc: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.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>fs, proc: introduce /proc/&lt;pid&gt;/task/&lt;tid&gt;/children entry</title>
<updated>2012-06-01T00:49:32Z</updated>
<author>
<name>Cyrill Gorcunov</name>
<email>gorcunov@openvz.org</email>
</author>
<published>2012-05-31T23:26:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=818411616baf46ceba0cff6f05af3a9b294734f7'/>
<id>urn:sha1:818411616baf46ceba0cff6f05af3a9b294734f7</id>
<content type='text'>
When we do checkpoint of a task we need to know the list of children the
task, has but there is no easy and fast way to generate reverse
parent-&gt;children chain from arbitrary &lt;pid&gt; (while a parent pid is
provided in "PPid" field of /proc/&lt;pid&gt;/status).

So instead of walking over all pids in the system (creating one big
process tree in memory, just to figure out which children a task has) --
we add explicit /proc/&lt;pid&gt;/task/&lt;tid&gt;/children entry, because the kernel
already has this kind of information but it is not yet exported.

This is a first level children, not the whole process tree.

Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Reviewed-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@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>procfs: use more apprioriate types when dumping /proc/N/stat</title>
<updated>2012-06-01T00:49:29Z</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2012-05-31T23:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=715be1fce0d964aca15618b24f6f415f3cbd03c8'/>
<id>urn:sha1:715be1fce0d964aca15618b24f6f415f3cbd03c8</id>
<content type='text'>
- use int fpr priority and nice, since task_nice()/task_prio() return that

- field 24: get_mm_rss() returns unsigned long

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&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>userns: Convert proc to use kuid/kgid where appropriate</title>
<updated>2012-05-15T21:59:28Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2012-02-09T16:48:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dcb0f22282e680ee5202ab7574ce78beb3803a9f'/>
<id>urn:sha1:dcb0f22282e680ee5202ab7574ce78beb3803a9f</id>
<content type='text'>
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>userns: Convert group_info values from gid_t to kgid_t.</title>
<updated>2012-05-03T10:27:21Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2011-11-14T23:56:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ae2975bc3476243b45a1e2344236d7920c268f38'/>
<id>urn:sha1:ae2975bc3476243b45a1e2344236d7920c268f38</id>
<content type='text'>
As a first step to converting struct cred to be all kuid_t and kgid_t
values convert the group values stored in group_info to always be
kgid_t values.   Unless user namespaces are used this change should
have no effect.

Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>procfs: fix /proc/statm</title>
<updated>2012-03-29T00:14:35Z</updated>
<author>
<name>KAMEZAWA Hiroyuki</name>
<email>kamezawa.hiroyu@jp.fujitsu.com</email>
</author>
<published>2012-03-28T21:42:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3748b2f15b06ea1861df39d5e9693dcd6e9542b1'/>
<id>urn:sha1:3748b2f15b06ea1861df39d5e9693dcd6e9542b1</id>
<content type='text'>
bda7bad62bc4 ("procfs: speed up /proc/pid/stat, statm") broke /proc/statm
- 'text' is printed twice by mistake.

Signed-off-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Reported-by: Ulrich Drepper &lt;drepper@gmail.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>procfs: speed up /proc/pid/stat, statm</title>
<updated>2012-03-23T23:58:42Z</updated>
<author>
<name>KAMEZAWA Hiroyuki</name>
<email>kamezawa.hiroyu@jp.fujitsu.com</email>
</author>
<published>2012-03-23T22:02:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bda7bad62bc4c4e0783348e8db51abe094153c56'/>
<id>urn:sha1:bda7bad62bc4c4e0783348e8db51abe094153c56</id>
<content type='text'>
Process accounting applications as top, ps visit some files under
/proc/&lt;pid&gt;.  With seq_put_decimal_ull(), we can optimize /proc/&lt;pid&gt;/stat
and /proc/&lt;pid&gt;/statm files.

This patch adds
  - seq_put_decimal_ll() for signed values.
  - allow delimiter == 0.
  - convert seq_printf() to seq_put_decimal_ull/ll in /proc/stat, statm.

Test result on a system with 2000+ procs.

Before patch:
  [kamezawa@bluextal test]$ top -b -n 1 | wc -l
  2223
  [kamezawa@bluextal test]$ time top -b -n 1 &gt; /dev/null

  real    0m0.675s
  user    0m0.044s
  sys     0m0.121s

  [kamezawa@bluextal test]$ time ps -elf &gt; /dev/null

  real    0m0.236s
  user    0m0.056s
  sys     0m0.176s

After patch:
  kamezawa@bluextal ~]$ time top -b -n 1 &gt; /dev/null

  real    0m0.657s
  user    0m0.052s
  sys     0m0.100s

  [kamezawa@bluextal ~]$ time ps -elf &gt; /dev/null

  real    0m0.198s
  user    0m0.050s
  sys     0m0.145s

Considering top, ps tend to scan /proc periodically, this will reduce cpu
consumption by top/ps to some extent.

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.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>Merge branch 'for-linus' of git://selinuxproject.org/~jmorris/linux-security</title>
<updated>2012-01-15T02:36:33Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-01-15T02:36:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c49c41a4134679cecb77362e7f6b59acb6320aa7'/>
<id>urn:sha1:c49c41a4134679cecb77362e7f6b59acb6320aa7</id>
<content type='text'>
* 'for-linus' of git://selinuxproject.org/~jmorris/linux-security:
  capabilities: remove __cap_full_set definition
  security: remove the security_netlink_recv hook as it is equivalent to capable()
  ptrace: do not audit capability check when outputing /proc/pid/stat
  capabilities: remove task_ns_* functions
  capabitlies: ns_capable can use the cap helpers rather than lsm call
  capabilities: style only - move capable below ns_capable
  capabilites: introduce new has_ns_capabilities_noaudit
  capabilities: call has_ns_capability from has_capability
  capabilities: remove all _real_ interfaces
  capabilities: introduce security_capable_noaudit
  capabilities: reverse arguments to security_capable
  capabilities: remove the task from capable LSM hook entirely
  selinux: sparse fix: fix several warnings in the security server cod
  selinux: sparse fix: fix warnings in netlink code
  selinux: sparse fix: eliminate warnings for selinuxfs
  selinux: sparse fix: declare selinux_disable() in security.h
  selinux: sparse fix: move selinux_complete_init
  selinux: sparse fix: make selinux_secmark_refcount static
  SELinux: Fix RCU deref check warning in sel_netport_insert()

Manually fix up a semantic mis-merge wrt security_netlink_recv():

 - the interface was removed in commit fd7784615248 ("security: remove
   the security_netlink_recv hook as it is equivalent to capable()")

 - a new user of it appeared in commit a38f7907b926 ("crypto: Add
   userspace configuration API")

causing no automatic merge conflict, but Eric Paris pointed out the
issue.
</content>
</entry>
<entry>
<title>c/r: procfs: add start_data, end_data, start_brk members to /proc/$pid/stat v4</title>
<updated>2012-01-13T04:13:13Z</updated>
<author>
<name>Cyrill Gorcunov</name>
<email>gorcunov@openvz.org</email>
</author>
<published>2012-01-13T01:20:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b3f7f573a20081910e34e99cbc91831f4f02f1ff'/>
<id>urn:sha1:b3f7f573a20081910e34e99cbc91831f4f02f1ff</id>
<content type='text'>
The mm-&gt;start_code/end_code, mm-&gt;start_data/end_data, mm-&gt;start_brk are
involved into calculation of program text/data segment sizes (which might
be seen in /proc/&lt;pid&gt;/statm) and into brk() call final address.

For restore we need to know all these values.  While
mm-&gt;start_code/end_code already present in /proc/$pid/stat, the rest
members are not, so this patch brings them in.

The restore procedure of these members is addressed in another patch using
prctl().

Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Andrew Vagin &lt;avagin@openvz.org&gt;
Cc: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.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>ptrace: do not audit capability check when outputing /proc/pid/stat</title>
<updated>2012-01-05T23:53:00Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2012-01-03T17:25:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=69f594a38967f4540ce7a29b3fd214e68a8330bd'/>
<id>urn:sha1:69f594a38967f4540ce7a29b3fd214e68a8330bd</id>
<content type='text'>
Reading /proc/pid/stat of another process checks if one has ptrace permissions
on that process.  If one does have permissions it outputs some data about the
process which might have security and attack implications.  If the current
task does not have ptrace permissions the read still works, but those fields
are filled with inocuous (0) values.  Since this check and a subsequent denial
is not a violation of the security policy we should not audit such denials.

This can be quite useful to removing ptrace broadly across a system without
flooding the logs when ps is run or something which harmlessly walks proc.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: Serge E. Hallyn &lt;serge.hallyn@canonical.com&gt;
</content>
</entry>
</feed>
