<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glibc/sysdeps/pthread/sem_open.c, branch vdso</title>
<subtitle>Fork of glibc for development</subtitle>
<id>https://git.zx2c4.com/glibc/atom/sysdeps/pthread/sem_open.c?h=vdso</id>
<link rel='self' href='https://git.zx2c4.com/glibc/atom/sysdeps/pthread/sem_open.c?h=vdso'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/'/>
<updated>2024-01-01T18:53:40Z</updated>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2024-01-01T18:53:40Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2024-01-01T18:12:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=dff8da6b3e89b986bb7f6b1ec18cf65d5972e307'/>
<id>urn:sha1:dff8da6b3e89b986bb7f6b1ec18cf65d5972e307</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sysdeps: sem_open: Clear O_CREAT when semaphore file is expected to exist [BZ #30789]</title>
<updated>2023-11-03T18:19:38Z</updated>
<author>
<name>Sergio Durigan Junior</name>
<email>sergiodj@sergiodj.net</email>
</author>
<published>2023-11-01T22:15:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=f957f47df75b9fab995754011491edebc6feb147'/>
<id>urn:sha1:f957f47df75b9fab995754011491edebc6feb147</id>
<content type='text'>
When invoking sem_open with O_CREAT as one of its flags, we'll end up
in the second part of sem_open's "if ((oflag &amp; O_CREAT) == 0 || (oflag
&amp; O_EXCL) == 0)", which means that we don't expect the semaphore file
to exist.

In that part, open_flags is initialized as "O_RDWR | O_CREAT | O_EXCL
| O_CLOEXEC" and there's an attempt to open(2) the file, which will
likely fail because it won't exist.  After that first (expected)
failure, some cleanup is done and we go back to the label "try_again",
which lives in the first part of the aforementioned "if".

The problem is that, in that part of the code, we expect the semaphore
file to exist, and as such O_CREAT (this time the flag we pass to
open(2)) needs to be cleaned from open_flags, otherwise we'll see
another failure (this time unexpected) when trying to open the file,
which will lead the call to sem_open to fail as well.

This can cause very strange bugs, especially with OpenMPI, which makes
extensive use of semaphores.

Fix the bug by simplifying the logic when choosing open(2) flags and
making sure O_CREAT is not set when the semaphore file is expected to
exist.

A regression test for this issue would require a complex and cpu time
consuming logic, since to trigger the wrong code path is not
straightforward due the racy condition.  There is a somewhat reliable
reproducer in the bug, but it requires using OpenMPI.

This resolves BZ #30789.

See also: https://bugs.launchpad.net/ubuntu/+source/h5py/+bug/2031912

Signed-off-by: Sergio Durigan Junior &lt;sergiodj@sergiodj.net&gt;
Co-Authored-By: Simon Chopin &lt;simon.chopin@canonical.com&gt;
Co-Authored-By: Adhemerval Zanella Netto &lt;adhemerval.zanella@linaro.org&gt;
Fixes: 533deafbdf189f5fbb280c28562dd43ace2f4b0f ("Use O_CLOEXEC in more places (BZ #15722)")
</content>
</entry>
<entry>
<title>Use O_CLOEXEC in more places (BZ #15722)</title>
<updated>2023-04-22T11:50:14Z</updated>
<author>
<name>Sergey Bugaev</name>
<email>bugaevc@gmail.com</email>
</author>
<published>2023-04-19T16:02:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=533deafbdf189f5fbb280c28562dd43ace2f4b0f'/>
<id>urn:sha1:533deafbdf189f5fbb280c28562dd43ace2f4b0f</id>
<content type='text'>
When opening a temporary file without O_CLOEXEC we risk leaking the
file descriptor if another thread calls (fork and then) exec while we
have the fd open. Fix this by consistently passing O_CLOEXEC everywhere
where we open a file for internal use (and not to return it to the user,
in which case the API defines whether or not the close-on-exec flag
shall be set on the returned fd).

Reviewed-by: Adhemerval Zanella &lt;adhemerval.zanella@linaro.org&gt;
Signed-off-by: Sergey Bugaev &lt;bugaevc@gmail.com&gt;
Message-Id: &lt;20230419160207.65988-4-bugaevc@gmail.com&gt;
</content>
</entry>
<entry>
<title>rt: fix shm_open not set ENAMETOOLONG when name exceeds {_POSIX_PATH_MAX}</title>
<updated>2023-03-08T13:11:54Z</updated>
<author>
<name>abushwang</name>
<email>abushwangs@gmail.com</email>
</author>
<published>2023-03-07T12:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=0b7bf0e0a486da6be7c5dde742a80c1138f9cc89'/>
<id>urn:sha1:0b7bf0e0a486da6be7c5dde742a80c1138f9cc89</id>
<content type='text'>
according to man-pages-posix-2017, shm_open() function may fail if the length
of the name argument exceeds {_POSIX_PATH_MAX} and set ENAMETOOLONG

Signed-off-by: abushwang &lt;abushwangs@gmail.com&gt;
Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2023-01-06T21:14:39Z</updated>
<author>
<name>Joseph Myers</name>
<email>joseph@codesourcery.com</email>
</author>
<published>2023-01-06T21:08:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=6d7e8eda9b85b08f207a6dc6f187e94e4817270f'/>
<id>urn:sha1:6d7e8eda9b85b08f207a6dc6f187e94e4817270f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2022-01-01T19:40:24Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2022-01-01T18:54:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=581c785bf31bc74430320c7856bbfa3875d025fe'/>
<id>urn:sha1:581c785bf31bc74430320c7856bbfa3875d025fe</id>
<content type='text'>
I used these shell commands:

../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright
(cd ../glibc &amp;&amp; git commit -am"[this commit message]")

and then ignored the output, which consisted lines saying "FOO: warning:
copyright statement not found" for each of 7061 files FOO.

I then removed trailing white space from math/tgmath.h,
support/tst-support-open-dev-null-range.c, and
sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following
obscure pre-commit check failure diagnostics from Savannah.  I don't
know why I run into these diagnostics whereas others evidently do not.

remote: *** 912-#endif
remote: *** 913:
remote: *** 914-
remote: *** error: lines with trailing whitespace found
...
remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
</content>
</entry>
<entry>
<title>Remove "Contributed by" lines</title>
<updated>2021-09-03T16:36:44Z</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@sourceware.org</email>
</author>
<published>2021-09-03T16:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=30891f35fa7da832b66d80d0807610df361851f3'/>
<id>urn:sha1:30891f35fa7da832b66d80d0807610df361851f3</id>
<content type='text'>
We stopped adding "Contributed by" or similar lines in sources in 2012
in favour of git logs and keeping the Contributors section of the
glibc manual up to date.  Removing these lines makes the license
header a bit more consistent across files and also removes the
possibility of error in attribution when license blocks or files are
copied across since the contributed-by lines don't actually reflect
reality in those cases.

Move all "Contributed by" and similar lines (Written by, Test by,
etc.) into a new file CONTRIBUTED-BY to retain record of these
contributions.  These contributors are also mentioned in
manual/contrib.texi, so we just maintain this additional record as a
courtesy to the earlier developers.

The following scripts were used to filter a list of files to edit in
place and to clean up the CONTRIBUTED-BY file respectively.  These
were not added to the glibc sources because they're not expected to be
of any use in future given that this is a one time task:

https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc
https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02

Reviewed-by: Carlos O'Donell &lt;carlos@redhat.com&gt;
</content>
</entry>
<entry>
<title>nptl: Move sem_close, sem_open into libc</title>
<updated>2021-05-05T15:19:38Z</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2021-05-05T15:15:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=0b7d48d1062e4383b4a78e0bb78c5f0f29479780'/>
<id>urn:sha1:0b7d48d1062e4383b4a78e0bb78c5f0f29479780</id>
<content type='text'>
The symbols were moved using move-symbol-to-libc.py.

Both functions are moved at the same time because they depend
on internal functions in sysdeps/pthread/sem_routines.c, which
are moved in this commit as well.  Additional hidden prototypes
are required to avoid check-localplt failures.

Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
</entry>
<entry>
<title>nptl: Remove open from libpthread</title>
<updated>2021-03-26T16:37:14Z</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2021-03-12T23:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=40873cdd38533a00f3d4f67b85fd5c0a07d7952e'/>
<id>urn:sha1:40873cdd38533a00f3d4f67b85fd5c0a07d7952e</id>
<content type='text'>
The libc version is identical and built with same flags.  The libc
version is set as the default version.

Checked on x86_64-linux-gnu.
</content>
</entry>
<entry>
<title>nptl: Remove close from libpthread</title>
<updated>2021-03-18T18:54:24Z</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2021-03-12T19:26:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=bdfed2e2cd166536d03a247925f6df3800ec4acc'/>
<id>urn:sha1:bdfed2e2cd166536d03a247925f6df3800ec4acc</id>
<content type='text'>
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
</content>
</entry>
</feed>
