<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/ipc, branch v2.6.23</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.23</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.23'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2007-07-31T22:39:40Z</updated>
<entry>
<title>Fix user struct leakage with locked IPC shem segment</title>
<updated>2007-07-31T22:39:40Z</updated>
<author>
<name>Pavel Emelianov</name>
<email>xemul@openvz.org</email>
</author>
<published>2007-07-31T07:38:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7be77e20d59fc3dd3fdde31641e0bc821114d26b'/>
<id>urn:sha1:7be77e20d59fc3dd3fdde31641e0bc821114d26b</id>
<content type='text'>
When user locks an ipc shmem segmant with SHM_LOCK ctl and the segment is
already locked the shmem_lock() function returns 0.  After this the
subsequent code leaks the existing user struct:

== ipc/shm.c: sys_shmctl() ==
     ...
     err = shmem_lock(shp-&gt;shm_file, 1, user);
     if (!err) {
          shp-&gt;shm_perm.mode |= SHM_LOCKED;
          shp-&gt;mlock_user = user;
     }
     ...
==

Other results of this are:
1. the new shp-&gt;mlock_user is not get-ed and will point to freed
   memory when the task dies.
2. the RLIMIT_MEMLOCK is screwed on both user structs.

The exploit looks like this:

==
    id = shmget(...);
    setresuid(uid, 0, 0);
    shmctl(id, SHM_LOCK, NULL);
    setresuid(uid + 1, 0, 0);
    shmctl(id, SHM_LOCK, NULL);
==

My solution is to return 0 to the userspace and do not change the
segment's user.

Signed-off-by: Pavel Emelianov &lt;xemul@openvz.org&gt;
Cc: &lt;stable@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>NOMMU: Fix SYSV IPC SHM</title>
<updated>2007-07-31T22:39:36Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2007-07-31T07:37:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e92a3baee64112fd210a930276bad165b0bd576'/>
<id>urn:sha1:2e92a3baee64112fd210a930276bad165b0bd576</id>
<content type='text'>
Fix the SYSV IPC SHM to work with the changes applied by the new fault handler
patches when CONFIG_MMU=n.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Cc: Nick Piggin &lt;nickpiggin@yahoo.com.au&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>mm: Remove slab destructors from kmem_cache_create().</title>
<updated>2007-07-20T01:11:58Z</updated>
<author>
<name>Paul Mundt</name>
<email>lethal@linux-sh.org</email>
</author>
<published>2007-07-20T01:11:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=20c2df83d25c6a95affe6157a4c9cac4cf5ffaac'/>
<id>urn:sha1:20c2df83d25c6a95affe6157a4c9cac4cf5ffaac</id>
<content type='text'>
Slab destructors were no longer supported after Christoph's
c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
BUGs for both slab and slub, and slob never supported them
either.

This rips out support for the dtor pointer from kmem_cache_create()
completely and fixes up every single callsite in the kernel (there were
about 224, not including the slab allocator definitions themselves,
or the documentation references).

Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
</content>
</entry>
<entry>
<title>mm: fault feedback #1</title>
<updated>2007-07-19T17:04:41Z</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@suse.de</email>
</author>
<published>2007-07-19T08:47:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d0217ac04ca6591841e5665f518e38064f4e65bd'/>
<id>urn:sha1:d0217ac04ca6591841e5665f518e38064f4e65bd</id>
<content type='text'>
Change -&gt;fault prototype.  We now return an int, which contains
VM_FAULT_xxx code in the low byte, and FAULT_RET_xxx code in the next byte.
 FAULT_RET_ code tells the VM whether a page was found, whether it has been
locked, and potentially other things.  This is not quite the way he wanted
it yet, but that's changed in the next patch (which requires changes to
arch code).

This means we no longer set VM_CAN_INVALIDATE in the vma in order to say
that a page is locked which requires filemap_nopage to go away (because we
can no longer remain backward compatible without that flag), but we were
going to do that anyway.

struct fault_data is renamed to struct vm_fault as Linus asked. address
is now a void __user * that we should firmly encourage drivers not to use
without really good reason.

The page is now returned via a page pointer in the vm_fault struct.

Signed-off-by: Nick Piggin &lt;npiggin@suse.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>mm: merge populate and nopage into fault (fixes nonlinear)</title>
<updated>2007-07-19T17:04:41Z</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@suse.de</email>
</author>
<published>2007-07-19T08:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54cb8821de07f2ffcd28c380ce9b93d5784b40d7'/>
<id>urn:sha1:54cb8821de07f2ffcd28c380ce9b93d5784b40d7</id>
<content type='text'>
Nonlinear mappings are (AFAIKS) simply a virtual memory concept that encodes
the virtual address -&gt; file offset differently from linear mappings.

-&gt;populate is a layering violation because the filesystem/pagecache code
should need to know anything about the virtual memory mapping.  The hitch here
is that the -&gt;nopage handler didn't pass down enough information (ie.  pgoff).
 But it is more logical to pass pgoff rather than have the -&gt;nopage function
calculate it itself anyway (because that's a similar layering violation).

Having the populate handler install the pte itself is likewise a nasty thing
to be doing.

This patch introduces a new fault handler that replaces -&gt;nopage and
-&gt;populate and (later) -&gt;nopfn.  Most of the old mechanism is still in place
so there is a lot of duplication and nice cleanups that can be removed if
everyone switches over.

The rationale for doing this in the first place is that nonlinear mappings are
subject to the pagefault vs invalidate/truncate race too, and it seemed stupid
to duplicate the synchronisation logic rather than just consolidate the two.

After this patch, MAP_NONBLOCK no longer sets up ptes for pages present in
pagecache.  Seems like a fringe functionality anyway.

NOPAGE_REFAULT is removed.  This should be implemented with -&gt;fault, and no
users have hit mainline yet.

[akpm@linux-foundation.org: cleanup]
[randy.dunlap@oracle.com: doc. fixes for readahead]
[akpm@linux-foundation.org: build fix]
Signed-off-by: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: Mark Fasheh &lt;mark.fasheh@oracle.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>arch/i386/* fs/* ipc/*: mark variables with uninitialized_var()</title>
<updated>2007-07-17T20:23:19Z</updated>
<author>
<name>Jeff Garzik</name>
<email>jeff@garzik.org</email>
</author>
<published>2007-07-17T09:40:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e1c091cccd551557d24ce845715e8ceb6c49d36'/>
<id>urn:sha1:8e1c091cccd551557d24ce845715e8ceb6c49d36</id>
<content type='text'>
Mark variables with uninitialized_var() if such a warning appears,
and analysis proves that the var is initialized properly on all paths
it is used.

Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>remove CONFIG_UTS_NS and CONFIG_IPC_NS</title>
<updated>2007-07-16T16:05:47Z</updated>
<author>
<name>Cedric Le Goater</name>
<email>clg@fr.ibm.com</email>
</author>
<published>2007-07-16T06:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7d69a1f4a72b18876c99c697692b78339d491568'/>
<id>urn:sha1:7d69a1f4a72b18876c99c697692b78339d491568</id>
<content type='text'>
CONFIG_UTS_NS and CONFIG_IPC_NS have very little value as they only
deactivate the unshare of the uts and ipc namespaces and do not improve
performance.

Signed-off-by: Cedric Le Goater &lt;clg@fr.ibm.com&gt;
Acked-by: "Serge E. Hallyn" &lt;serue@us.ibm.com&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Herbert Poetzl &lt;herbert@13thfloor.at&gt;
Cc: Pavel Emelianov &lt;xemul@openvz.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>fix logic error in ipc compat semctl()</title>
<updated>2007-07-06T17:23:43Z</updated>
<author>
<name>Alexander Graf</name>
<email>agraf@suse.de</email>
</author>
<published>2007-07-06T09:39:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d57d973101e87b2e30ccfa899fe36c4b2e32d217'/>
<id>urn:sha1:d57d973101e87b2e30ccfa899fe36c4b2e32d217</id>
<content type='text'>
When calling a semctl(IPC_STAT) without IPC_64 the check if the memory is
unevaluated.  This patch fixes this.

Signed-off-by: Alexander Graf &lt;agraf@suse.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>shm: fix the filename of hugetlb sysv shared memory</title>
<updated>2007-06-16T20:16:16Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2007-06-16T17:16:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9d66586f7723b73c5925c7c7819c260484627851'/>
<id>urn:sha1:9d66586f7723b73c5925c7c7819c260484627851</id>
<content type='text'>
Some user space tools need to identify SYSV shared memory when examining
/proc/&lt;pid&gt;/maps.  To do so they look for a block device with major zero, a
dentry named SYSV&lt;sysv key&gt;, and having the minor of the internal sysv
shared memory kernel mount.

To help these tools and to make it easier for people just browsing
/proc/&lt;pid&gt;/maps this patch modifies hugetlb sysv shared memory to use the
SYSV&lt;key&gt; dentry naming convention.

User space tools will still have to be aware that hugetlb sysv shared
memory lives on a different internal kernel mount and so has a different
block device minor number from the rest of sysv shared memory.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: "Serge E. Hallyn" &lt;serge@hallyn.com&gt;
Cc: Albert Cahalan &lt;acahalan@gmail.com&gt;
Cc: Badari Pulavarty &lt;pbadari@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>
</entry>
<entry>
<title>hugetlb: fix get_policy for stacked shared memory files</title>
<updated>2007-06-16T20:16:16Z</updated>
<author>
<name>Adam Litke</name>
<email>agl@us.ibm.com</email>
</author>
<published>2007-06-16T17:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=22741925d268e8479ef66312749bd8d96ed35365'/>
<id>urn:sha1:22741925d268e8479ef66312749bd8d96ed35365</id>
<content type='text'>
Here's another breakage as a result of shared memory stacked files :(

The NUMA policy for a VMA is determined by checking the following (in the
order given):

1) vma-&gt;vm_ops-&gt;get_policy() (if defined)
2) vma-&gt;vm_policy (if defined)
3) task-&gt;mempolicy (if defined)
4) Fall back to default_policy

By switching to stacked files for shared memory, get_policy() is now always
set to shm_get_policy which is a wrapper function.  This causes us to stop
at step 1, which yields NULL for hugetlb instead of task-&gt;mempolicy which
was the previous (and correct) result.

This patch modifies the shm_get_policy() wrapper to maintain steps 1-3 for
the wrapped vm_ops.

(akpm: the refcounting of mempolicies is busted and this patch does nothing to
improve it)

Signed-off-by: Adam Litke &lt;agl@us.ibm.com&gt;
Acked-by: William Irwin &lt;bill.irwin@oracle.com&gt;
Cc: dean gaudet &lt;dean@arctic.org&gt;
Cc: Christoph Lameter &lt;clameter@sgi.com&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Cc: &lt;stable@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>
</feed>
