<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/proc/task_nommu.c, branch linux-2.6.28.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2008-10-10T00:24:51Z</updated>
<entry>
<title>proc: remove kernel.maps_protect</title>
<updated>2008-10-10T00:24:51Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2008-10-09T23:27:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3bbfe0596746e1590888a6e1e6a07583265238b7'/>
<id>urn:sha1:3bbfe0596746e1590888a6e1e6a07583265238b7</id>
<content type='text'>
After commit 831830b5a2b5d413407adf380ef62fe17d6fcbf2 aka
"restrict reading from /proc/&lt;pid&gt;/maps to those who share -&gt;mm or can ptrace"
sysctl stopped being relevant because commit moved security checks from -&gt;show
time to -&gt;start time (mm_for_maps()).

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Acked-by: Kees Cook &lt;kees.cook@canonical.com&gt;
</content>
</entry>
<entry>
<title>Security: split proc ptrace checking into read vs. attach</title>
<updated>2008-07-14T05:01:47Z</updated>
<author>
<name>Stephen Smalley</name>
</author>
<published>2008-05-19T12:32:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=006ebb40d3d65338bd74abb03b945f8d60e362bd'/>
<id>urn:sha1:006ebb40d3d65338bd74abb03b945f8d60e362bd</id>
<content type='text'>
Enable security modules to distinguish reading of process state via
proc from full ptrace access by renaming ptrace_may_attach to
ptrace_may_access and adding a mode argument indicating whether only
read access or full attach access is requested.  This allows security
modules to permit access to reading process state without granting
full ptrace access.  The base DAC/capability checking remains unchanged.

Read access to /proc/pid/mem continues to apply a full ptrace attach
check since check_mem_permission() already requires the current task
to already be ptracing the target.  The other ptrace checks within
proc for elements like environ, maps, and fds are changed to pass the
read mode instead of attach.

In the SELinux case, we model such reading of process state as a
reading of a proc file labeled with the target process' label.  This
enables SELinux policy to permit such reading of process state without
permitting control or manipulation of the target process, as there are
a number of cases where programs probe for such information via proc
but do not need to be able to control the target (e.g. procps,
lsof, PolicyKit, ConsoleKit).  At present we have to choose between
allowing full ptrace in policy (more permissive than required/desired)
or breaking functionality (or in some cases just silencing the denials
via dontaudit rules but this can hide genuine attacks).

This version of the patch incorporates comments from Casey Schaufler
(change/replace existing ptrace_may_attach interface, pass access
mode), and Chris Wright (provide greater consistency in the checking).

Note that like their predecessors __ptrace_may_attach and
ptrace_may_attach, the __ptrace_may_access and ptrace_may_access
interfaces use different return value conventions from each other (0
or -errno vs. 1 or 0).  I retained this difference to avoid any
changes to the caller logic but made the difference clearer by
changing the latter interface to return a bool rather than an int and
by adding a comment about it to ptrace.h for any future callers.

Signed-off-by:  Stephen Smalley &lt;sds@tycho.nsa.gov&gt;
Acked-by: Chris Wright &lt;chrisw@sous-sol.org&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>task_nommu: fix compile failing bug because of spilt file.h</title>
<updated>2008-05-05T00:08:48Z</updated>
<author>
<name>Bryan Wu</name>
</author>
<published>2008-05-04T15:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb28062f131b0a1da32b2554fd819af5221040de'/>
<id>urn:sha1:eb28062f131b0a1da32b2554fd819af5221040de</id>
<content type='text'>
  CC      fs/proc/task_nommu.o
fs/proc/task_nommu.c: In function ‘task_mem’:
fs/proc/task_nommu.c:55: error: dereferencing pointer to incomplete type
make[2]: *** [fs/proc/task_nommu.o] Error 1
make[1]: *** [fs/proc] Error 2
make: *** [fs] Error 2

Signed-off-by: Bryan Wu &lt;cooloney@kernel.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>procfs task exe symlink</title>
<updated>2008-04-29T15:06:17Z</updated>
<author>
<name>Matt Helsley</name>
</author>
<published>2008-04-29T08:01:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=925d1c401fa6cfd0df5d2e37da8981494ccdec07'/>
<id>urn:sha1:925d1c401fa6cfd0df5d2e37da8981494ccdec07</id>
<content type='text'>
The kernel implements readlink of /proc/pid/exe by getting the file from
the first executable VMA.  Then the path to the file is reconstructed and
reported as the result.

Because of the VMA walk the code is slightly different on nommu systems.
This patch avoids separate /proc/pid/exe code on nommu systems.  Instead of
walking the VMAs to find the first executable file-backed VMA we store a
reference to the exec'd file in the mm_struct.

That reference would prevent the filesystem holding the executable file
from being unmounted even after unmapping the VMAs.  So we track the number
of VM_EXECUTABLE VMAs and drop the new reference when the last one is
unmapped.  This avoids pinning the mounted filesystem.

[akpm@linux-foundation.org: improve comments]
[yamamoto@valinux.co.jp: fix dup_mmap]
Signed-off-by: Matt Helsley &lt;matthltc@us.ibm.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc:"Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Hugh Dickins &lt;hugh@veritas.com&gt;
Signed-off-by: YAMAMOTO Takashi &lt;yamamoto@valinux.co.jp&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>d_path: Make proc_get_link() use a struct path argument</title>
<updated>2008-02-15T05:17:08Z</updated>
<author>
<name>Jan Blunck</name>
</author>
<published>2008-02-15T03:38:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3dcd25f37cfe2943beca93f41f50994108248a60'/>
<id>urn:sha1:3dcd25f37cfe2943beca93f41f50994108248a60</id>
<content type='text'>
proc_get_link() is always called with a dentry and a vfsmount from a struct
path.  Make proc_get_link() take it directly as an argument.

Signed-off-by: Jan Blunck &lt;jblunck@suse.de&gt;
Acked-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Cc: Neil Brown &lt;neilb@suse.de&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>procfs: constify function pointer tables</title>
<updated>2008-02-08T17:22:38Z</updated>
<author>
<name>Jan Engelhardt</name>
</author>
<published>2008-02-08T12:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03a44825be987d720df854f63b2f7bd30e46bdde'/>
<id>urn:sha1:03a44825be987d720df854f63b2f7bd30e46bdde</id>
<content type='text'>
Signed-off-by: Jan Engelhardt &lt;jengelh@computergmbh.de&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Acked-By: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Bryan Wu &lt;bryan.wu@analog.com&gt;
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Cc: &lt;linux-arch@vger.kernel.org&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>proc: seqfile convert proc_pid_status to properly handle pid namespaces</title>
<updated>2008-02-08T17:22:24Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2008-02-08T12:18:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df5f8314ca30d6a76735748e5ba4ca9809c0f434'/>
<id>urn:sha1:df5f8314ca30d6a76735748e5ba4ca9809c0f434</id>
<content type='text'>
Currently we possibly lookup the pid in the wrong pid namespace.  So
seq_file convert proc_pid_status which ensures the proper pid namespaces is
passed in.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: another build fix]
[akpm@linux-foundation.org: s390 build fix]
[akpm@linux-foundation.org: fix task_name() output]
[akpm@linux-foundation.org: fix nommu build]
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Andrew Morgan &lt;morgan@kernel.org&gt;
Cc: Serge Hallyn &lt;serue@us.ibm.com&gt;
Cc: Cedric Le Goater &lt;clg@fr.ibm.com&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Paul Menage &lt;menage@google.com&gt;
Cc: Paul Jackson &lt;pj@sgi.com&gt;
Cc: David Rientjes &lt;rientjes@google.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>restrict reading from /proc/&lt;pid&gt;/maps to those who share -&gt;mm or can ptrace pid</title>
<updated>2008-01-02T21:13:27Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2008-01-02T14:09:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=831830b5a2b5d413407adf380ef62fe17d6fcbf2'/>
<id>urn:sha1:831830b5a2b5d413407adf380ef62fe17d6fcbf2</id>
<content type='text'>
Contents of /proc/*/maps is sensitive and may become sensitive after
open() (e.g.  if target originally shares our -&gt;mm and later does exec
on suid-root binary).

Check at read() (actually, -&gt;start() of iterator) time that mm_struct
we'd grabbed and locked is
 - still the -&gt;mm of target
 - equal to reader's -&gt;mm or the target is ptracable by reader.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Rik van Riel &lt;riel@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: maps protection</title>
<updated>2007-05-08T18:15:02Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2007-05-08T07:26:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5096add84b9e96e2e0a9c72675c442fe5433388a'/>
<id>urn:sha1:5096add84b9e96e2e0a9c72675c442fe5433388a</id>
<content type='text'>
The /proc/pid/ "maps", "smaps", and "numa_maps" files contain sensitive
information about the memory location and usage of processes.  Issues:

- maps should not be world-readable, especially if programs expect any
  kind of ASLR protection from local attackers.
- maps cannot just be 0400 because "-D_FORTIFY_SOURCE=2 -O2" makes glibc
  check the maps when %n is in a *printf call, and a setuid(getuid())
  process wouldn't be able to read its own maps file.  (For reference
  see http://lkml.org/lkml/2006/1/22/150)
- a system-wide toggle is needed to allow prior behavior in the case of
  non-root applications that depend on access to the maps contents.

This change implements a check using "ptrace_may_attach" before allowing
access to read the maps contents.  To control this protection, the new knob
/proc/sys/kernel/maps_protect has been added, with corresponding updates to
the procfs documentation.

[akpm@linux-foundation.org: build fixes]
[akpm@linux-foundation.org: New sysctl numbers are old hat]
Signed-off-by: Kees Cook &lt;kees@outflux.net&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&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>[PATCH] mark struct file_operations const 6</title>
<updated>2007-02-12T17:48:45Z</updated>
<author>
<name>Arjan van de Ven</name>
</author>
<published>2007-02-12T08:55:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=00977a59b951207d38380c75f03a36829950265c'/>
<id>urn:sha1:00977a59b951207d38380c75f03a36829950265c</id>
<content type='text'>
Many struct file_operations in the kernel can be "const".  Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data.  In addition it'll catch accidental writes at compile time to
these shared resources.

Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.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>
</feed>
