<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src, branch v1.0.3</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>fix multiple validation issues in dns response label parsing</title>
<updated>2014-06-06T21:57:37+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2014-06-05T20:32:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=309cfa4f2c3a5596a024d0bff7bba326382884b4'/>
<id>309cfa4f2c3a5596a024d0bff7bba326382884b4</id>
<content type='text'>
Due to an error introduced in commit fcc522c92335783293ac19df318415cd97fbf66b,
checking of the remaining output buffer space was not performed correctly,
allowing malformed input to write past the end of the buffer.

In addition, the loop detection logic failed to account for the possibility
of infinite loops with no output, which would hang the function.

The output size is now limited more strictly so only names with valid length
are accepted.

(cherry picked from commit b3d9e0b94ea73c68ef4169ec82c898ce59a4e30a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Due to an error introduced in commit fcc522c92335783293ac19df318415cd97fbf66b,
checking of the remaining output buffer space was not performed correctly,
allowing malformed input to write past the end of the buffer.

In addition, the loop detection logic failed to account for the possibility
of infinite loops with no output, which would hang the function.

The output size is now limited more strictly so only names with valid length
are accepted.

(cherry picked from commit b3d9e0b94ea73c68ef4169ec82c898ce59a4e30a)
</pre>
</div>
</content>
</entry>
<entry>
<title>remove some dummy "ent" function aliases that duplicated real ones</title>
<updated>2014-06-06T21:57:36+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-06-04T08:39:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=8daa49cdfd5c74fb8edf931394be11c62b915e52'/>
<id>8daa49cdfd5c74fb8edf931394be11c62b915e52</id>
<content type='text'>
the service and protocol functions are defined also in other files,
and the protocol ones are actually non-nops elsewhere, so the weak
definitions in ent.c could have prevented the strong definitions from
getting pulled in and used in some static programs.

(cherry picked from commit 934aa1350b96461f205ad69c95e8f6f035f6b62c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the service and protocol functions are defined also in other files,
and the protocol ones are actually non-nops elsewhere, so the weak
definitions in ent.c could have prevented the strong definitions from
getting pulled in and used in some static programs.

(cherry picked from commit 934aa1350b96461f205ad69c95e8f6f035f6b62c)
</pre>
</div>
</content>
</entry>
<entry>
<title>fix if_nametoindex return value when interface does not exist</title>
<updated>2014-06-06T21:57:36+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-06-03T21:53:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=f8b5cc8a7e7482560f1b781d43a271c496a6d55c'/>
<id>f8b5cc8a7e7482560f1b781d43a271c496a6d55c</id>
<content type='text'>
the return value is unsigned, so negative results for "errors" do not
make sense; 0 is the value reserved for when the interface name does
not exist.

(cherry picked from commit 8041af59881219c32267c3491bee43591d3c3fe6)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the return value is unsigned, so negative results for "errors" do not
make sense; 0 is the value reserved for when the interface name does
not exist.

(cherry picked from commit 8041af59881219c32267c3491bee43591d3c3fe6)
</pre>
</div>
</content>
</entry>
<entry>
<title>fix incorrect end pointer in some cases when wcsrtombs stops early</title>
<updated>2014-06-06T21:57:36+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-06-02T20:21:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=5fa12af8daeaa71add0ccd15e082c01154545def'/>
<id>5fa12af8daeaa71add0ccd15e082c01154545def</id>
<content type='text'>
when wcsrtombs stopped due to hitting zero remaining space in the
output buffer, it was wrongly clearing the position pointer as if it
had completed the conversion successfully.

this commit rearranges the code somewhat to make a clear separation
between the cases of ending due to running out of output buffer space,
and ending due to reaching the end of input or an illegal sequence in
the input. the new branches have been arranged with the hope of
optimizing more common cases, too.

(cherry picked from commit 8fba4458afb7304b32ca887e4a3990c6029131f9)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
when wcsrtombs stopped due to hitting zero remaining space in the
output buffer, it was wrongly clearing the position pointer as if it
had completed the conversion successfully.

this commit rearranges the code somewhat to make a clear separation
between the cases of ending due to running out of output buffer space,
and ending due to reaching the end of input or an illegal sequence in
the input. the new branches have been arranged with the hope of
optimizing more common cases, too.

(cherry picked from commit 8fba4458afb7304b32ca887e4a3990c6029131f9)
</pre>
</div>
</content>
</entry>
<entry>
<title>fix for broken kernel side RLIM_INFINITY on mips</title>
<updated>2014-06-06T21:57:36+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2014-05-30T06:47:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=94100a0115af03d478c93b8875aae0409a62186f'/>
<id>94100a0115af03d478c93b8875aae0409a62186f</id>
<content type='text'>
On 32 bit mips the kernel uses -1UL/2 to mark RLIM_INFINITY (and
this is the definition in the userspace api), but since it is in
the middle of the valid range of limits and limits are often
compared with relational operators, various kernel side logic is
broken if larger than -1UL/2 limits are used. So we truncate the
limits to -1UL/2 in get/setrlimit and prlimit.

Even if the kernel side logic consistently treated -1UL/2 as greater
than any other limit value, there wouldn't be any clean workaround
that allowed using large limits:
* using -1UL/2 as RLIM_INFINITY in userspace would mean different
infinity value for get/setrlimt and prlimit (where infinity is always
-1ULL) and userspace logic could break easily (just like the kernel
is broken now) and more special case code would be needed for mips.
* translating -1UL/2 kernel side value to -1ULL in userspace would
mean that -1UL/2 limit cannot be set (eg. -1UL/2+1 had to be passed
to the kernel instead).

(cherry picked from commit 8258014fd1e34e942a549c88c7e022a00445c352)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On 32 bit mips the kernel uses -1UL/2 to mark RLIM_INFINITY (and
this is the definition in the userspace api), but since it is in
the middle of the valid range of limits and limits are often
compared with relational operators, various kernel side logic is
broken if larger than -1UL/2 limits are used. So we truncate the
limits to -1UL/2 in get/setrlimit and prlimit.

Even if the kernel side logic consistently treated -1UL/2 as greater
than any other limit value, there wouldn't be any clean workaround
that allowed using large limits:
* using -1UL/2 as RLIM_INFINITY in userspace would mean different
infinity value for get/setrlimt and prlimit (where infinity is always
-1ULL) and userspace logic could break easily (just like the kernel
is broken now) and more special case code would be needed for mips.
* translating -1UL/2 kernel side value to -1ULL in userspace would
mean that -1UL/2 limit cannot be set (eg. -1UL/2+1 had to be passed
to the kernel instead).

(cherry picked from commit 8258014fd1e34e942a549c88c7e022a00445c352)
</pre>
</div>
</content>
</entry>
<entry>
<title>fix sendfile syscall to use 64-bit off_t</title>
<updated>2014-06-06T21:56:36+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-06-06T21:56:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=94a2c04c906188a9ec0e990179a033ec91c1f988'/>
<id>94a2c04c906188a9ec0e990179a033ec91c1f988</id>
<content type='text'>
somehow the remapping of this syscall to the 64-bit version was
overlooked. the issue was found, and patch provided, by Stefan
Kristiansson. presumably the reason this bug was not caught earlier is
that the syscall takes a pointer to off_t rather than a value, so on
little-endian systems, everything appears to work as long as the
offset value fits in the low 31 bits. on big-endian systems, though,
sendfile was presumably completely non-functional.

corresponds to commit 55f45bc7222ec50b72aa8411c61e30184d0ade23 in
master branch.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
somehow the remapping of this syscall to the 64-bit version was
overlooked. the issue was found, and patch provided, by Stefan
Kristiansson. presumably the reason this bug was not caught earlier is
that the syscall takes a pointer to off_t rather than a value, so on
little-endian systems, everything appears to work as long as the
offset value fits in the low 31 bits. on big-endian systems, though,
sendfile was presumably completely non-functional.

corresponds to commit 55f45bc7222ec50b72aa8411c61e30184d0ade23 in
master branch.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix unhandled cases in strptime</title>
<updated>2014-05-20T21:58:25+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-05-20T02:14:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=ba9cb2e57d154fcfd8659dde987d4799380e3e9e'/>
<id>ba9cb2e57d154fcfd8659dde987d4799380e3e9e</id>
<content type='text'>
%C, %U, %W, and %y handling were completely missing; %C wrongly
fell-through to unrelated cases, and the rest returned failure. for
now, they all parse numbers in the proper forms and range-check the
values, but they do not store the value anywhere.

it's not clear to me whether, as "derived" fields, %U and %W should
produce any result. they certainly cannot produce a result unless the
year and weekday are also converted, but in this case it might be
desirable for them to do so. clarification is needed on the intended
behavior of strptime in cases like this.

%C and %y have well-defined behavior as long as they are used together
(and %y is defined by itself but may change in the future).
implementing them (including their correct interaction) is left as a
later change to be made.

finally, strptime now rejects unknown/invalid format characters
instead of ignoring them.

(cherry picked from commit dec66750b8ed4493d5bb40042f7a473e60fe934e)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
%C, %U, %W, and %y handling were completely missing; %C wrongly
fell-through to unrelated cases, and the rest returned failure. for
now, they all parse numbers in the proper forms and range-check the
values, but they do not store the value anywhere.

it's not clear to me whether, as "derived" fields, %U and %W should
produce any result. they certainly cannot produce a result unless the
year and weekday are also converted, but in this case it might be
desirable for them to do so. clarification is needed on the intended
behavior of strptime in cases like this.

%C and %y have well-defined behavior as long as they are used together
(and %y is defined by itself but may change in the future).
implementing them (including their correct interaction) is left as a
later change to be made.

finally, strptime now rejects unknown/invalid format characters
instead of ignoring them.

(cherry picked from commit dec66750b8ed4493d5bb40042f7a473e60fe934e)
</pre>
</div>
</content>
</entry>
<entry>
<title>fix strftime %s not to zero pad with default width=2</title>
<updated>2014-05-20T21:58:25+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2014-05-08T17:04:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=45619f5c2309246ef9eac99f4ef01aea23f52ea7'/>
<id>45619f5c2309246ef9eac99f4ef01aea23f52ea7</id>
<content type='text'>
(cherry picked from commit ac0acd569e01735fc6052d43fdf57f3a07c93f3d)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit ac0acd569e01735fc6052d43fdf57f3a07c93f3d)
</pre>
</div>
</content>
</entry>
<entry>
<title>remove useless __yield alias for sched_yield</title>
<updated>2014-05-20T21:58:24+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-05-04T17:15:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=3555f146a58789fe9c415f6cf396097e709deef9'/>
<id>3555f146a58789fe9c415f6cf396097e709deef9</id>
<content type='text'>
this is no longer used for anything, and reportedly clashed with a
builtin on certain compilers.

(cherry picked from commit adbf0258be4eea5f012e173de7e55a87f3093669)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this is no longer used for anything, and reportedly clashed with a
builtin on certain compilers.

(cherry picked from commit adbf0258be4eea5f012e173de7e55a87f3093669)
</pre>
</div>
</content>
</entry>
<entry>
<title>perform minimal sanity checks on zoneinfo files loaded via TZ variable</title>
<updated>2014-05-20T21:58:24+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-04-23T00:09:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=c7776e708e796587f8e264bd51a7ffe74422c26b'/>
<id>c7776e708e796587f8e264bd51a7ffe74422c26b</id>
<content type='text'>
previously, setting TZ to the pathname of a file which was not a valid
zoneinfo file would usually cause programs using local time zone based
operations to crash. the new code checks the file size and magic at
the beginning of the file, which seems sufficient to prevent
accidental misconfiguration from causing crashes. attempting to make
fully-robust validation would be futile unless we wanted to drop use
of mmap (shared zoneinfo) and instead read it into a local buffer,
since such validation would be subject to race conditions with
modification of the file.

(cherry picked from commit c3d9d172b1fcd56c4d356798f4e3b4653076bcc3)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
previously, setting TZ to the pathname of a file which was not a valid
zoneinfo file would usually cause programs using local time zone based
operations to crash. the new code checks the file size and magic at
the beginning of the file, which seems sufficient to prevent
accidental misconfiguration from causing crashes. attempting to make
fully-robust validation would be futile unless we wanted to drop use
of mmap (shared zoneinfo) and instead read it into a local buffer,
since such validation would be subject to race conditions with
modification of the file.

(cherry picked from commit c3d9d172b1fcd56c4d356798f4e3b4653076bcc3)
</pre>
</div>
</content>
</entry>
</feed>
