<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/ipc, branch v3.10.10</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/ipc?h=v3.10.10</id>
<link rel='self' href='https://git.amat.us/linux/atom/ipc?h=v3.10.10'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-05-26T22:14:51Z</updated>
<entry>
<title>ipc/sem.c: Fix missing wakeups in do_smart_update_queue()</title>
<updated>2013-05-26T22:14:51Z</updated>
<author>
<name>Manfred Spraul</name>
<email>manfred@colorfullife.com</email>
</author>
<published>2013-05-26T09:08:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ab465df9dda42a997f7537c875127eeb6a88158c'/>
<id>urn:sha1:ab465df9dda42a997f7537c875127eeb6a88158c</id>
<content type='text'>
do_smart_update_queue() is called when an operation (semop,
semctl(SETVAL), semctl(SETALL), ...) modified the array.  It must check
which of the sleeping tasks can proceed.

do_smart_update_queue() missed a few wakeups:
 - if a sleeping complex op was completed, then all per-semaphore queues
   must be scanned - not only those that were modified by *sops
 - if a sleeping simple op proceeded, then the global queue must be
   scanned again

And:
 - the test for "|sops == NULL) before scanning the global queue is not
   required: If the global queue is empty, then it doesn't need to be
   scanned - regardless of the reason for calling do_smart_update_queue()

The patch is not optimized, i.e.  even completing a wait-for-zero
operation causes a rescan.  This is done to keep the patch as simple as
possible.

Signed-off-by: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Acked-by: Davidlohr Bueso &lt;davidlohr.bueso@hp.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: 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 null pointer deref when userspace specifies invalid hugepage size</title>
<updated>2013-05-09T21:22:47Z</updated>
<author>
<name>Li Zefan</name>
<email>lizefan@huawei.com</email>
</author>
<published>2013-05-09T07:08:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=091d0d55b286c9340201b4ed4470be87fc568228'/>
<id>urn:sha1:091d0d55b286c9340201b4ed4470be87fc568228</id>
<content type='text'>
Dave reported an oops triggered by trinity:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
  IP: newseg+0x10d/0x390
  PGD cf8c1067 PUD cf8c2067 PMD 0
  Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
  CPU: 2 PID: 7636 Comm: trinity-child2 Not tainted 3.9.0+#67
  ...
  Call Trace:
    ipcget+0x182/0x380
    SyS_shmget+0x5a/0x60
    tracesys+0xdd/0xe2

This bug was introduced by commit af73e4d9506d ("hugetlbfs: fix mmap
failure in unaligned size request").

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Li Zefan &lt;lizfan@huawei.com&gt;
Reviewed-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&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>ipc,sem: fix semctl(..., GETNCNT)</title>
<updated>2013-05-09T21:17:47Z</updated>
<author>
<name>Rik van Riel</name>
<email>riel@redhat.com</email>
</author>
<published>2013-05-09T20:59:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=de2657f94acd4f0df44626db7c4d2b71babc8cd3'/>
<id>urn:sha1:de2657f94acd4f0df44626db7c4d2b71babc8cd3</id>
<content type='text'>
The semctl GETNCNT returns the number of semops waiting for the
specified semaphore to become nonzero.  After commit 9f1bc2c9022c
("ipc,sem: have only one list in struct sem_queue"), the semops waiting
on just one semaphore are waiting on that semaphore's list.

In order to return the correct count, we have to walk that list too, in
addition to the sem_array's list for complex operations.

Signed-off-by: Rik van Riel &lt;riel@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc,sem: fix semctl(..., GETZCNT)</title>
<updated>2013-05-09T21:17:47Z</updated>
<author>
<name>Rik van Riel</name>
<email>riel@redhat.com</email>
</author>
<published>2013-05-09T20:53:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ebc2e5e6a408a0e6ed63c0ba98c2c8a232c6b4f4'/>
<id>urn:sha1:ebc2e5e6a408a0e6ed63c0ba98c2c8a232c6b4f4</id>
<content type='text'>
The semctl GETZCNT returns the number of semops waiting for the
specified semaphore to become zero.  After commit 9f1bc2c9022c
("ipc,sem: have only one list in struct sem_queue"), the semops waiting
on just one semaphore are waiting on that semaphore's list.

In order to return the correct count, we have to walk that list too, in
addition to the sem_array's list for complex operations.

This bug broke dbench; it works again with this patch applied.

Signed-off-by: Rik van Riel &lt;riel@redhat.com&gt;
Reported-by: Kent Overstreet &lt;koverstreet@google.com&gt;
Tested-by: Kent Overstreet &lt;koverstreet@google.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>hugetlbfs: fix mmap failure in unaligned size request</title>
<updated>2013-05-08T01:38:27Z</updated>
<author>
<name>Naoya Horiguchi</name>
<email>n-horiguchi@ah.jp.nec.com</email>
</author>
<published>2013-05-07T23:18:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=af73e4d9506d3b797509f3c030e7dcd554f7d9c4'/>
<id>urn:sha1:af73e4d9506d3b797509f3c030e7dcd554f7d9c4</id>
<content type='text'>
The current kernel returns -EINVAL unless a given mmap length is
"almost" hugepage aligned.  This is because in sys_mmap_pgoff() the
given length is passed to vm_mmap_pgoff() as it is without being aligned
with hugepage boundary.

This is a regression introduced in commit 40716e29243d ("hugetlbfs: fix
alignment of huge page requests"), where alignment code is pushed into
hugetlb_file_setup() and the variable len in caller side is not changed.

To fix this, this patch partially reverts that commit, and adds
alignment code in caller side.  And it also introduces hstate_sizelog()
in order to get proper hstate to specified hugepage size.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=56881

[akpm@linux-foundation.org: fix warning when CONFIG_HUGETLB_PAGE=n]
Signed-off-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Signed-off-by: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Reported-by: &lt;iceman_dvd@yahoo.com&gt;
Cc: Steven Truelove &lt;steven.truelove@utoronto.ca&gt;
Cc: Jianguo Wu &lt;wujianguo@huawei.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: &lt;stable@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>ipc: simplify rcu_read_lock() in semctl_nolock()</title>
<updated>2013-05-05T00:24:59Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-04T18:04:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=941b0304a74b240c607ff098401fd4ef70c9d1cc'/>
<id>urn:sha1:941b0304a74b240c607ff098401fd4ef70c9d1cc</id>
<content type='text'>
This trivially combines two rcu_read_lock() calls in both sides of a
if-statement into one single one in front of the if-statement.

Split out as an independent cleanup from the previous commit.

Acked-by: Davidlohr Bueso &lt;davidlohr.bueso@hp.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc: simplify semtimedop/semctl_main() common error path handling</title>
<updated>2013-05-05T00:21:58Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-04T18:04:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c728b9c87b59fb943c4cba0552d38152787a4ab6'/>
<id>urn:sha1:c728b9c87b59fb943c4cba0552d38152787a4ab6</id>
<content type='text'>
With various straight RCU lock/unlock movements, one common exit path
pattern had become

	rcu_read_unlock();
	goto out_wakeup;

and in fact there were no cases where we wanted to exit to out_wakeup
_without_ releasing the RCU read lock.

So replace that pattern with "goto out_rcu_wakeup", and remove the old
out_wakeup.

Acked-by: Davidlohr Bueso &lt;davidlohr.bueso@hp.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc: move sem_obtain_lock() rcu locking into the only caller</title>
<updated>2013-05-05T00:20:14Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-04T17:47:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=321310ced2d6cc0175c76fa512fa8a829ee35223'/>
<id>urn:sha1:321310ced2d6cc0175c76fa512fa8a829ee35223</id>
<content type='text'>
sem_obtain_lock() was another of those functions that returned with the
RCU lock held for reading in the success case.  Move the RCU locking to
the caller (semtimedop()), making it more obvious.  We already did RCU
locking elsewhere in that function.

Side note: why does semtimedop() re-do the semphore lookup after the
sleep, rather than just getting a reference to the semaphore it already
looked up originally?

Acked-by: Davidlohr Bueso &lt;davidlohr.bueso@hp.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc: fix double sem unlock in semctl error path</title>
<updated>2013-05-05T00:19:59Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-04T17:25:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fbfd1d2862a8316c7191bc551c6a842e6918abb0'/>
<id>urn:sha1:fbfd1d2862a8316c7191bc551c6a842e6918abb0</id>
<content type='text'>
Fix another ipc locking buglet introduced by the scalability patches:
when semctl_down() was changed to delay the semaphore locking, one error
path for security_sem_semctl() went through the semaphore unlock logic
even though the semaphore had never been locked.

Introduced by commit 16df3674efe3 ("ipc,sem: do not hold ipc lock more
than necessary")

Acked-by: Davidlohr Bueso &lt;davidlohr.bueso@hp.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc: move the rcu_read_lock() from sem_lock_and_putref() into callers</title>
<updated>2013-05-05T00:19:39Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-04T17:13:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4091fd942e96af5a0b1dfa6aac5f44153ebf7cdb'/>
<id>urn:sha1:4091fd942e96af5a0b1dfa6aac5f44153ebf7cdb</id>
<content type='text'>
This is another ipc semaphore locking cleanup, trying to make the
locking more straightforward.  We move the rcu read locking into the
callers of sem_lock_and_putref(), which in general means that we now
mostly do the rcu_read_lock() and rcu_read_unlock() in the same
function.

Mostly.  We still have the ipc_addid/newary/freeary mess, and things
like ipcctl_pre_down_nolock().

Acked-by: Davidlohr Bueso &lt;davidlohr.bueso@hp.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
