<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/linux, branch master</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>statx: fix uninitialized attributes/mask in fallback path</title>
<updated>2024-09-13T21:11:00+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2024-09-13T21:08:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=4ca8c267768e371930ef7ec9593a5f8b44a7f810'/>
<id>4ca8c267768e371930ef7ec9593a5f8b44a7f810</id>
<content type='text'>
commit b817541f1cfd38e4b81257b3215e276ea9d0fc61 introduced statx with
a fallback using fstatat, but failed to fill in stx_rdev_major/minor
and stx_attributes[_mask]. the rdev omission has been addressed
separately. rather than explicitly zeroing the attributes and their
mask, pre-fill the entire structure with zeros. this will also cover
the padding adjacent to stx_mode, in case it's ever used in the
future.

explicit zeroing of stx_btime is removed since, with this change, it
will already be pre-zeroed. as an aside, zeroing it was not strictly
necessary, since STATX_BASIC_STATS does not include STATX_BTIME and
thus does not indicate any validity for it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b817541f1cfd38e4b81257b3215e276ea9d0fc61 introduced statx with
a fallback using fstatat, but failed to fill in stx_rdev_major/minor
and stx_attributes[_mask]. the rdev omission has been addressed
separately. rather than explicitly zeroing the attributes and their
mask, pre-fill the entire structure with zeros. this will also cover
the padding adjacent to stx_mode, in case it's ever used in the
future.

explicit zeroing of stx_btime is removed since, with this change, it
will already be pre-zeroed. as an aside, zeroing it was not strictly
necessary, since STATX_BASIC_STATS does not include STATX_BTIME and
thus does not indicate any validity for it.
</pre>
</div>
</content>
</entry>
<entry>
<title>statx: fix ENOSYS emulation not setting stx_rdev_*</title>
<updated>2024-09-13T20:58:21+00:00</updated>
<author>
<name>Gabriel Ravier</name>
<email>gabravier@gmail.com</email>
</author>
<published>2024-09-13T20:00:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=251cbb6366403a056b39638264932c82d18ec610'/>
<id>251cbb6366403a056b39638264932c82d18ec610</id>
<content type='text'>
The current implementation of the statx function fails to set the
values of stx-&gt;stx_rdev_major and stx-&gt;stx_rdev_minor if the statx
syscall fails with ENOSYS and thus the statx function has to fall back
on fstatat-based emulation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current implementation of the statx function fails to set the
values of stx-&gt;stx_rdev_major and stx-&gt;stx_rdev_minor if the statx
syscall fails with ENOSYS and thus the statx function has to fall back
on fstatat-based emulation.
</pre>
</div>
</content>
</entry>
<entry>
<title>add renameat2 linux syscall wrapper</title>
<updated>2024-05-23T13:13:49+00:00</updated>
<author>
<name>Tony Ambardar</name>
<email>tony.ambardar@gmail.com</email>
</author>
<published>2024-05-07T03:28:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=05ce67fea99ca09cd4b6625cff7aec9cc222dd5a'/>
<id>05ce67fea99ca09cd4b6625cff7aec9cc222dd5a</id>
<content type='text'>
This syscall is available since Linux 3.15 and also implemented in
glibc from version 2.28. It is commonly used in filesystem or security
contexts.

Constants RENAME_NOREPLACE, RENAME_EXCHANGE, RENAME_WHITEOUT are
guarded by _GNU_SOURCE as with glibc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This syscall is available since Linux 3.15 and also implemented in
glibc from version 2.28. It is commonly used in filesystem or security
contexts.

Constants RENAME_NOREPLACE, RENAME_EXCHANGE, RENAME_WHITEOUT are
guarded by _GNU_SOURCE as with glibc.
</pre>
</div>
</content>
</entry>
<entry>
<title>riscv: fall back to syscall __riscv_flush_icache</title>
<updated>2024-02-26T01:35:24+00:00</updated>
<author>
<name>Stefan O'Rear</name>
<email>sorear@fastmail.com</email>
</author>
<published>2020-09-03T09:23:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=2c887f24da36fa30eccd72e50d91222828fa526e'/>
<id>2c887f24da36fa30eccd72e50d91222828fa526e</id>
<content type='text'>
Matches glibc behavior and fixes a case where we could fall off the
function without returning a value.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Matches glibc behavior and fixes a case where we could fall off the
function without returning a value.
</pre>
</div>
</content>
</entry>
<entry>
<title>add statx interface using syscall, fallback to fstatat</title>
<updated>2024-02-24T17:27:09+00:00</updated>
<author>
<name>Duncan Bellamy</name>
<email>dunk@denkimushi.com</email>
</author>
<published>2022-08-31T19:07:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=b817541f1cfd38e4b81257b3215e276ea9d0fc61'/>
<id>b817541f1cfd38e4b81257b3215e276ea9d0fc61</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add framework to support archs without a native wait4 syscall</title>
<updated>2024-02-22T23:50:34+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2024-02-22T23:50:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=19563e1850808af216b1b84263bb7e83cccce506'/>
<id>19563e1850808af216b1b84263bb7e83cccce506</id>
<content type='text'>
this commit should make no codegen change for existing archs, but is a
prerequisite for new archs including riscv32. the wait4 emulation
backend provides both cancellable and non-cancellable variants because
waitpid is required to be a cancellation point, but all of our other
uses are not, and most of them cannot be.

based on patch by Stefan O'Rear.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this commit should make no codegen change for existing archs, but is a
prerequisite for new archs including riscv32. the wait4 emulation
backend provides both cancellable and non-cancellable variants because
waitpid is required to be a cancellation point, but all of our other
uses are not, and most of them cannot be.

based on patch by Stefan O'Rear.
</pre>
</div>
</content>
</entry>
<entry>
<title>riscv: correct symbol version of __vdso_flush_icache</title>
<updated>2024-02-04T00:49:42+00:00</updated>
<author>
<name>gns</name>
<email>infiwang@proton.me</email>
</author>
<published>2024-01-25T15:59:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=bd3138b74a06dd764508f399d1b58cb9d6c35c1f'/>
<id>bd3138b74a06dd764508f399d1b58cb9d6c35c1f</id>
<content type='text'>
Previously, __riscv_flush_icache would not work correctly as
__vdso_flush_icache had a wrong symbol version. Fix this by correcting
symbol version.

Fixes: 0a48860c27a8 ("add riscv64 architecture support")
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, __riscv_flush_icache would not work correctly as
__vdso_flush_icache had a wrong symbol version. Fix this by correcting
symbol version.

Fixes: 0a48860c27a8 ("add riscv64 architecture support")
</pre>
</div>
</content>
</entry>
<entry>
<title>add preadv2 and pwritev2 syscall wrappers, flag value macros</title>
<updated>2024-01-25T17:02:34+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2024-01-25T17:02:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=81cced6ebeb4419a78a8892ec7d7e28f5582d24a'/>
<id>81cced6ebeb4419a78a8892ec7d7e28f5582d24a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>move ppoll from src/linux to src/select reflecting future standardization</title>
<updated>2024-01-21T22:18:36+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2024-01-21T22:18:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=07af01816d65b49a901cd784db69a030a6213e03'/>
<id>07af01816d65b49a901cd784db69a030a6213e03</id>
<content type='text'>
the ppoll function has been accepted as a future part of the standard
as the outcome of Austin Group tracker issue 1263. move the source
file to reflect this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the ppoll function has been accepted as a future part of the standard
as the outcome of Austin Group tracker issue 1263. move the source
file to reflect this.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix public clone function to be safe and usable by applications</title>
<updated>2023-06-01T20:15:38+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2023-05-31T16:04:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=fa4a8abd06a401822cc8ba4e352a219544c0118d'/>
<id>fa4a8abd06a401822cc8ba4e352a219544c0118d</id>
<content type='text'>
the clone() function has been effectively unusable since it was added,
due to producing a child process with inconsistent state. in
particular, the child process's thread structure still contains the
tid, thread list pointers, thread count, and robust list for the
parent. this will cause malfunction in interfaces that attempt to use
the tid or thread list, some of which are specified to be
async-signal-safe.

this patch attempts to make clone() consistent in a _Fork-like sense.
as in _Fork, when the parent process is multi-threaded, the child
process inherits an async-signal context where it cannot call
AS-unsafe functions, but its context is now intended to be safe for
calling AS-safe functions. making clone fork-like would also be a
future option, if it turns out that this is what makes sense to
applications, but it's not done at this time because the changes would
be more invasive.

in the case where the CLONE_VM flag is used, clone is only vfork-like,
not _Fork-like. in particular, the child will see itself as having the
parent's tid, and cannot safely call any libc functions but one of the
exec family or _exit.

handling of flags and variadic arguments is also changed so that
arguments are only consumed with flags that indicate their presence,
and so that flags which produce an inconsistent state are disallowed
(reported as EINVAL). in particular, all libc functions carry a
contract that they are only callable with ABI requirements met, which
includes having a valid thread pointer to a thread structure that's
unique within the process, and whose contents are opaque and only able
to be setup internally by the implementation. the only way for an
application to use flags that violate these requirements without
executing any libc code is to perform the syscall from
application-provided asm.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the clone() function has been effectively unusable since it was added,
due to producing a child process with inconsistent state. in
particular, the child process's thread structure still contains the
tid, thread list pointers, thread count, and robust list for the
parent. this will cause malfunction in interfaces that attempt to use
the tid or thread list, some of which are specified to be
async-signal-safe.

this patch attempts to make clone() consistent in a _Fork-like sense.
as in _Fork, when the parent process is multi-threaded, the child
process inherits an async-signal context where it cannot call
AS-unsafe functions, but its context is now intended to be safe for
calling AS-safe functions. making clone fork-like would also be a
future option, if it turns out that this is what makes sense to
applications, but it's not done at this time because the changes would
be more invasive.

in the case where the CLONE_VM flag is used, clone is only vfork-like,
not _Fork-like. in particular, the child will see itself as having the
parent's tid, and cannot safely call any libc functions but one of the
exec family or _exit.

handling of flags and variadic arguments is also changed so that
arguments are only consumed with flags that indicate their presence,
and so that flags which produce an inconsistent state are disallowed
(reported as EINVAL). in particular, all libc functions carry a
contract that they are only callable with ABI requirements met, which
includes having a valid thread pointer to a thread structure that's
unique within the process, and whose contents are opaque and only able
to be setup internally by the implementation. the only way for an
application to use flags that violate these requirements without
executing any libc code is to perform the syscall from
application-provided asm.
</pre>
</div>
</content>
</entry>
</feed>
