<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/ipc, branch v1.0.2</title>
<subtitle>musl - an implementation of the standard library for Linux-based systems</subtitle>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/'/>
<entry>
<title>semctl: fix UB causing crashes on powerpc</title>
<updated>2014-03-13T19:52:34+00:00</updated>
<author>
<name>rofl0r</name>
<email>retnyg@gmx.net</email>
</author>
<published>2014-03-13T19:27:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=2b47a7aff24bbfbe7ba89fc6d542acc9f5493ae2'/>
<id>2b47a7aff24bbfbe7ba89fc6d542acc9f5493ae2</id>
<content type='text'>
it's UB to fetch variadic args when none are passed, and this caused
real crashes on ppc due to its calling convention, which defines that
for variadic functions aggregate types be passed as pointers.
the assignment caused that pointer to get dereferenced, resulting in
a crash.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
it's UB to fetch variadic args when none are passed, and this caused
real crashes on ppc due to its calling convention, which defines that
for variadic functions aggregate types be passed as pointers.
the assignment caused that pointer to get dereferenced, resulting in
a crash.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix inadvertent use of struct in place of union for semun</title>
<updated>2014-01-08T22:37:05+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-01-08T22:37:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=8e776e3ed40a4fb084e3d671d887825049c8f0cf'/>
<id>8e776e3ed40a4fb084e3d671d887825049c8f0cf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix type of semctl variadic argument</title>
<updated>2014-01-08T21:12:47+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-01-08T21:12:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=289294220f278a291452332da8f45cf756f57fe5'/>
<id>289294220f278a291452332da8f45cf756f57fe5</id>
<content type='text'>
per POSIX, the variadic argument has type union semun, which may
contain a pointer or int; the type read depends on the command being
issued. this allows the userspace part of the implementation to be
type-correct without requiring special-casing for different commands.
the kernel always expects to receive the argument interpreted as
unsigned long (or equivalently, a pointer), and does its own handling
of extracting the int portion from the representation, as needed.

this change fixes two possible issues: most immediately, reading the
argument as a (signed) long and passing it to the syscall would
perform incorrect sign-extension of pointers on the upcoming x32
target. the other possible issue is that some archs may use different
(user-space) argument-passing convention for unions, preventing va_arg
from correctly obtaining the argument when the type long (or even
unsigned long or void *) is passed to it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
per POSIX, the variadic argument has type union semun, which may
contain a pointer or int; the type read depends on the command being
issued. this allows the userspace part of the implementation to be
type-correct without requiring special-casing for different commands.
the kernel always expects to receive the argument interpreted as
unsigned long (or equivalently, a pointer), and does its own handling
of extracting the int portion from the representation, as needed.

this change fixes two possible issues: most immediately, reading the
argument as a (signed) long and passing it to the syscall would
perform incorrect sign-extension of pointers on the upcoming x32
target. the other possible issue is that some archs may use different
(user-space) argument-passing convention for unions, preventing va_arg
from correctly obtaining the argument when the type long (or even
unsigned long or void *) is passed to it.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix harmless inconsistency in semtimedop</title>
<updated>2013-11-09T22:54:20+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2013-11-09T22:54:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=35cf8b3e7303ed52638be600a0ab7d0ba35eb594'/>
<id>35cf8b3e7303ed52638be600a0ab7d0ba35eb594</id>
<content type='text'>
this should not matter since the reality is that either all the sysv
sem syscalls are individual syscalls, or all of them are multiplexed
on the SYS_ipc syscall (depending on arch). but best to be consistent
anyway.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this should not matter since the reality is that either all the sysv
sem syscalls are individual syscalls, or all of them are multiplexed
on the SYS_ipc syscall (depending on arch). but best to be consistent
anyway.
</pre>
</div>
</content>
</entry>
<entry>
<title>implement semtimedop</title>
<updated>2013-11-09T05:18:57+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2013-11-09T05:18:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=4571f9f856d8d6c1643b516c27f861dbab66ec00'/>
<id>4571f9f856d8d6c1643b516c27f861dbab66ec00</id>
<content type='text'>
this is a Linux-specific extension to the sysv semaphore api.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this is a Linux-specific extension to the sysv semaphore api.
</pre>
</div>
</content>
</entry>
<entry>
<title>prevent shmget from allocating objects that overflow ptrdiff_t</title>
<updated>2013-06-29T04:02:38+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2013-06-29T04:02:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=17aef0b41e3d7cb37c476cbe2df26fc444518a64'/>
<id>17aef0b41e3d7cb37c476cbe2df26fc444518a64</id>
<content type='text'>
rather than returning an error, we have to increase the size argument
so high that the kernel will have no choice but to fail. this is
because POSIX only permits the EINVAL error for size errors when a new
shared memory segment would be created; if it already exists, the size
argument must be ignored. unfortunately Linux is non-conforming in
this regard, but I want to keep the code correct in userspace anyway
so that if/when Linux is fixed, the behavior applications see will be
conforming.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rather than returning an error, we have to increase the size argument
so high that the kernel will have no choice but to fail. this is
because POSIX only permits the EINVAL error for size errors when a new
shared memory segment would be created; if it already exists, the size
argument must be ignored. unfortunately Linux is non-conforming in
this regard, but I want to keep the code correct in userspace anyway
so that if/when Linux is fixed, the behavior applications see will be
conforming.
</pre>
</div>
</content>
</entry>
<entry>
<title>work around wrong kernel type for sem_nsems member of struct semid_ds</title>
<updated>2013-06-29T03:57:58+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2013-06-29T03:57:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=062f40ef3e56021f4a9902095867e35cce6d99c4'/>
<id>062f40ef3e56021f4a9902095867e35cce6d99c4</id>
<content type='text'>
rejecting invalid values for n is fine even in the case where a new
sem will not be created, since the kernel does its range checks on n
even in this case as well.

by default, the kernel will bound the limit well below USHRT_MAX
anyway, but it's presumably possible that an administrator could
override this limit and break things.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rejecting invalid values for n is fine even in the case where a new
sem will not be created, since the kernel does its range checks on n
even in this case as well.

by default, the kernel will bound the limit well below USHRT_MAX
anyway, but it's presumably possible that an administrator could
override this limit and break things.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix shmdt syscall calling convention on old archs</title>
<updated>2012-10-28T19:04:26+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-10-28T19:04:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=86dd1e7bbb1e0901b7f07ed41be5dc98fd39f5ef'/>
<id>86dd1e7bbb1e0901b7f07ed41be5dc98fd39f5ef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix remaining IPC_64 issue (shmctl)</title>
<updated>2012-09-22T20:08:58+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-09-22T20:08:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=15d111203221e988b45b47535f96889f4208c1a7'/>
<id>15d111203221e988b45b47535f96889f4208c1a7</id>
<content type='text'>
also cleanup cruft related to the issue
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
also cleanup cruft related to the issue
</pre>
</div>
</content>
</entry>
<entry>
<title>fix IPC_64 in msgctl too</title>
<updated>2012-09-22T12:04:17+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2012-09-22T12:04:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=cccc13221da78957aa6dc813a325c13f1a930874'/>
<id>cccc13221da78957aa6dc813a325c13f1a930874</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
