<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glibc.git/sysdeps, branch zack/remove-libcrypt</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/'/>
<entry>
<title>Remove all of the remaining libcrypt code.</title>
<updated>2023-09-21T20:24:59+00:00</updated>
<author>
<name>Zack Weinberg</name>
<email>zack@owlfolio.org</email>
</author>
<published>2023-09-21T18:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=46e817c4982dfda6aaf6863c141b2e56cfc75acd'/>
<id>46e817c4982dfda6aaf6863c141b2e56cfc75acd</id>
<content type='text'>
Completing the removal of libcrypt, delete all of its actual code.
This patch contains only file removals:

git rm -r crypt
git rm include/crypt.h
git rm $(find sysdeps -name libcrypt.abilist)
git rm $(find sysdeps -name fips-private.h)
git rm $(find sysdeps -name 'md5-*' -o -name 'sha256-*' -o -name 'sha512-*')

For this patch (not the earlier ones, I'd still be waiting) I ran the
complete testsuite and found no *new* failures.  26 tests are failing
on my machine due to probable environment issues, but they were all
failing on trunk before I started making changes, and none of them
appear to have anything to do with this patchset.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Completing the removal of libcrypt, delete all of its actual code.
This patch contains only file removals:

git rm -r crypt
git rm include/crypt.h
git rm $(find sysdeps -name libcrypt.abilist)
git rm $(find sysdeps -name fips-private.h)
git rm $(find sysdeps -name 'md5-*' -o -name 'sha256-*' -o -name 'sha512-*')

For this patch (not the earlier ones, I'd still be waiting) I ran the
complete testsuite and found no *new* failures.  26 tests are failing
on my machine due to probable environment issues, but they were all
failing on trunk before I started making changes, and none of them
appear to have anything to do with this patchset.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove --enable-crypt and --enable-nss-crypt configure options.</title>
<updated>2023-09-21T20:21:41+00:00</updated>
<author>
<name>Zack Weinberg</name>
<email>zack@owlfolio.org</email>
</author>
<published>2023-09-21T15:22:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=a0b80d284cd22b88fc2da9a06cf81de8f2460e26'/>
<id>a0b80d284cd22b88fc2da9a06cf81de8f2460e26</id>
<content type='text'>
This makes it impossible to build libcrypt, so add a NEWS entry for
the removal at this point, and remove the prototype for crypt() from
unistd.h.  Also removed at this point are a handful of references to
libcrypt in other directories (notably elf/, conform/, and SPARCv9
sysdep Makefiles) and in maintainer-facing scripts and docs.

stdio-common/Versions says that __snprintf is exported as
GLIBC_PRIVATE because libcrypt uses it.  I doubt that was the only
ancillary library using that symbol, but I don't know how to find
other uses, so I left the export in place; it can always be removed
later.

There are a few files of test data that mention the crypt directory
and/or its contents, e.g. benchtests/strcoll-inputs/filelist#en_US.UTF-8.
As best I can tell, the intent of these is just to have a big pile of
strings and it doesn't matter whether the named files exist, so I
haven't altered them.

The actual code, and the remainder of the documentation, will be
deleted in subsequent patches.

(I seem to have a slightly different version of autoconf than the one
that was last used to regenerate the top-level configure script.  If
that's a problem, let me know.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes it impossible to build libcrypt, so add a NEWS entry for
the removal at this point, and remove the prototype for crypt() from
unistd.h.  Also removed at this point are a handful of references to
libcrypt in other directories (notably elf/, conform/, and SPARCv9
sysdep Makefiles) and in maintainer-facing scripts and docs.

stdio-common/Versions says that __snprintf is exported as
GLIBC_PRIVATE because libcrypt uses it.  I doubt that was the only
ancillary library using that symbol, but I don't know how to find
other uses, so I left the export in place; it can always be removed
later.

There are a few files of test data that mention the crypt directory
and/or its contents, e.g. benchtests/strcoll-inputs/filelist#en_US.UTF-8.
As best I can tell, the intent of these is just to have a big pile of
strings and it doesn't matter whether the named files exist, so I
haven't altered them.

The actual code, and the remainder of the documentation, will be
deleted in subsequent patches.

(I seem to have a slightly different version of autoconf than the one
that was last used to regenerate the top-level configure script.  If
that's a problem, let me know.)
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "LoongArch: Add glibc.cpu.hwcap support."</title>
<updated>2023-09-21T01:10:11+00:00</updated>
<author>
<name>caiyinyu</name>
<email>caiyinyu@loongson.cn</email>
</author>
<published>2023-09-21T01:10:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=672b91ba1060887aa8897d0b98af83b96d4a52b0'/>
<id>672b91ba1060887aa8897d0b98af83b96d4a52b0</id>
<content type='text'>
This reverts commit a53451559dc9cce765ea5bcbb92c4007e058e92b.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit a53451559dc9cce765ea5bcbb92c4007e058e92b.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update kernel version to 6.5 in header constant tests</title>
<updated>2023-09-20T13:36:46+00:00</updated>
<author>
<name>Joseph Myers</name>
<email>joseph@codesourcery.com</email>
</author>
<published>2023-09-20T13:36:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=457bb77255a59c736467d05a6ee9631328fee21b'/>
<id>457bb77255a59c736467d05a6ee9631328fee21b</id>
<content type='text'>
This patch updates the kernel version in the tests tst-mman-consts.py
and tst-pidfd-consts.py to 6.5.  (There are no new constants covered
by these tests in 6.5 that need any other header changes;
tst-mount-consts.py was updated separately along with a header
constant addition.)

Tested with build-many-glibcs.py.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch updates the kernel version in the tests tst-mman-consts.py
and tst-pidfd-consts.py to 6.5.  (There are no new constants covered
by these tests in 6.5 that need any other header changes;
tst-mount-consts.py was updated separately along with a header
constant addition.)

Tested with build-many-glibcs.py.
</pre>
</div>
</content>
</entry>
<entry>
<title>LoongArch: Add glibc.cpu.hwcap support.</title>
<updated>2023-09-19T01:11:49+00:00</updated>
<author>
<name>caiyinyu</name>
<email>caiyinyu@loongson.cn</email>
</author>
<published>2023-09-15T09:35:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=a53451559dc9cce765ea5bcbb92c4007e058e92b'/>
<id>a53451559dc9cce765ea5bcbb92c4007e058e92b</id>
<content type='text'>
Key Points:
1. On lasx &amp; lsx platforms, We must use _dl_runtime_{profile, resolve}_{lsx, lasx}
   to save vector registers.
2. Via "tunables", users can choose str/mem_{lasx,lsx,unaligned} functions with
   `export GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,...`.
   Note: glibc.cpu.hwcaps doesn't affect _dl_runtime_{profile, resolve}_{lsx, lasx}
   selection.

Usage Notes:
1. Only valid inputs: LASX, LSX, UAL. Case-sensitive, comma-separated, no spaces.
2. Example: `export GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,UAL` turns on LASX &amp; UAL.
   Unmentioned features turn off. With default ifunc: lasx &gt; lsx &gt; unaligned &gt;
   aligned &gt; generic, effect is: lasx &gt; unaligned &gt; aligned &gt; generic; lsx off.
3. Incorrect GLIBC_TUNABLES settings will show error messages.
   For example: On lsx platforms, you cannot enable lasx features. If you do
   that, you will get error messages.
4. Valid input examples:
   - GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX: lasx &gt; aligned &gt; generic.
   - GLIBC_TUNABLES=glibc.cpu.hwcaps=LSX,UAL: lsx &gt; unaligned &gt; aligned &gt; generic.
   - GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,UAL,LASX,UAL,LSX,LASX,UAL: Repetitions
     allowed but not recommended. Results in: lasx &gt; lsx &gt; unaligned &gt; aligned &gt;
     generic.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Key Points:
1. On lasx &amp; lsx platforms, We must use _dl_runtime_{profile, resolve}_{lsx, lasx}
   to save vector registers.
2. Via "tunables", users can choose str/mem_{lasx,lsx,unaligned} functions with
   `export GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,...`.
   Note: glibc.cpu.hwcaps doesn't affect _dl_runtime_{profile, resolve}_{lsx, lasx}
   selection.

Usage Notes:
1. Only valid inputs: LASX, LSX, UAL. Case-sensitive, comma-separated, no spaces.
2. Example: `export GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,UAL` turns on LASX &amp; UAL.
   Unmentioned features turn off. With default ifunc: lasx &gt; lsx &gt; unaligned &gt;
   aligned &gt; generic, effect is: lasx &gt; unaligned &gt; aligned &gt; generic; lsx off.
3. Incorrect GLIBC_TUNABLES settings will show error messages.
   For example: On lsx platforms, you cannot enable lasx features. If you do
   that, you will get error messages.
4. Valid input examples:
   - GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX: lasx &gt; aligned &gt; generic.
   - GLIBC_TUNABLES=glibc.cpu.hwcaps=LSX,UAL: lsx &gt; unaligned &gt; aligned &gt; generic.
   - GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,UAL,LASX,UAL,LSX,LASX,UAL: Repetitions
     allowed but not recommended. Results in: lasx &gt; lsx &gt; unaligned &gt; aligned &gt;
     generic.
</pre>
</div>
</content>
</entry>
<entry>
<title>getaddrinfo: Fix use after free in getcanonname (CVE-2023-4806)</title>
<updated>2023-09-15T18:38:28+00:00</updated>
<author>
<name>Siddhesh Poyarekar</name>
<email>siddhesh@sourceware.org</email>
</author>
<published>2023-09-15T17:51:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=973fe93a5675c42798b2161c6f29c01b0e243994'/>
<id>973fe93a5675c42798b2161c6f29c01b0e243994</id>
<content type='text'>
When an NSS plugin only implements the _gethostbyname2_r and
_getcanonname_r callbacks, getaddrinfo could use memory that was freed
during tmpbuf resizing, through h_name in a previous query response.

The backing store for res-&gt;at-&gt;name when doing a query with
gethostbyname3_r or gethostbyname2_r is tmpbuf, which is reallocated in
gethosts during the query.  For AF_INET6 lookup with AI_ALL |
AI_V4MAPPED, gethosts gets called twice, once for a v6 lookup and second
for a v4 lookup.  In this case, if the first call reallocates tmpbuf
enough number of times, resulting in a malloc, th-&gt;h_name (that
res-&gt;at-&gt;name refers to) ends up on a heap allocated storage in tmpbuf.
Now if the second call to gethosts also causes the plugin callback to
return NSS_STATUS_TRYAGAIN, tmpbuf will get freed, resulting in a UAF
reference in res-&gt;at-&gt;name.  This then gets dereferenced in the
getcanonname_r plugin call, resulting in the use after free.

Fix this by copying h_name over and freeing it at the end.  This
resolves BZ #30843, which is assigned CVE-2023-4806.

Signed-off-by: Siddhesh Poyarekar &lt;siddhesh@sourceware.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When an NSS plugin only implements the _gethostbyname2_r and
_getcanonname_r callbacks, getaddrinfo could use memory that was freed
during tmpbuf resizing, through h_name in a previous query response.

The backing store for res-&gt;at-&gt;name when doing a query with
gethostbyname3_r or gethostbyname2_r is tmpbuf, which is reallocated in
gethosts during the query.  For AF_INET6 lookup with AI_ALL |
AI_V4MAPPED, gethosts gets called twice, once for a v6 lookup and second
for a v4 lookup.  In this case, if the first call reallocates tmpbuf
enough number of times, resulting in a malloc, th-&gt;h_name (that
res-&gt;at-&gt;name refers to) ends up on a heap allocated storage in tmpbuf.
Now if the second call to gethosts also causes the plugin callback to
return NSS_STATUS_TRYAGAIN, tmpbuf will get freed, resulting in a UAF
reference in res-&gt;at-&gt;name.  This then gets dereferenced in the
getcanonname_r plugin call, resulting in the use after free.

Fix this by copying h_name over and freeing it at the end.  This
resolves BZ #30843, which is assigned CVE-2023-4806.

Signed-off-by: Siddhesh Poyarekar &lt;siddhesh@sourceware.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>LoongArch: Change to put magic number to .rodata section</title>
<updated>2023-09-15T01:07:47+00:00</updated>
<author>
<name>dengjianbo</name>
<email>dengjianbo@loongson.cn</email>
</author>
<published>2023-09-13T07:35:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=780adf7aeab9308c02d89260df6ffa84dc2289a5'/>
<id>780adf7aeab9308c02d89260df6ffa84dc2289a5</id>
<content type='text'>
Change to put magic number to .rodata section in memmove-lsx, and use
pcalau12i and %pc_lo12 with vld to get the data.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change to put magic number to .rodata section in memmove-lsx, and use
pcalau12i and %pc_lo12 with vld to get the data.
</pre>
</div>
</content>
</entry>
<entry>
<title>LoongArch: Add ifunc support for strrchr{aligned, lsx, lasx}</title>
<updated>2023-09-15T01:07:47+00:00</updated>
<author>
<name>dengjianbo</name>
<email>dengjianbo@loongson.cn</email>
</author>
<published>2023-09-13T07:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=24279aecf34a830a744038cb922d94b5a2d9c1cb'/>
<id>24279aecf34a830a744038cb922d94b5a2d9c1cb</id>
<content type='text'>
According to glibc strrchr microbenchmark test results, this implementation
could reduce the runtime time as following:

Name                Percent of rutime reduced
strrchr-lasx        10%-50%
strrchr-lsx         0%-50%
strrchr-aligned     5%-50%

Generic strrchr is implemented by function strlen + memrchr, the lasx version
will compare with generic strrchr implemented by strlen-lasx + memrchr-lasx,
the lsx version will compare with generic strrchr implemented by strlen-lsx +
memrchr-lsx, the aligned version will compare with generic strrchr implemented
by strlen-aligned + memrchr-generic.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to glibc strrchr microbenchmark test results, this implementation
could reduce the runtime time as following:

Name                Percent of rutime reduced
strrchr-lasx        10%-50%
strrchr-lsx         0%-50%
strrchr-aligned     5%-50%

Generic strrchr is implemented by function strlen + memrchr, the lasx version
will compare with generic strrchr implemented by strlen-lasx + memrchr-lasx,
the lsx version will compare with generic strrchr implemented by strlen-lsx +
memrchr-lsx, the aligned version will compare with generic strrchr implemented
by strlen-aligned + memrchr-generic.
</pre>
</div>
</content>
</entry>
<entry>
<title>LoongArch: Add ifunc support for strcpy, stpcpy{aligned, unaligned, lsx, lasx}</title>
<updated>2023-09-15T01:07:47+00:00</updated>
<author>
<name>dengjianbo</name>
<email>dengjianbo@loongson.cn</email>
</author>
<published>2023-09-13T07:34:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=06251002d4a1d92101ae7205be380887a4129471'/>
<id>06251002d4a1d92101ae7205be380887a4129471</id>
<content type='text'>
According to glibc strcpy and stpcpy microbenchmark test results(changed
to use generic_strcpy and generic_stpcpy instead of strlen + memcpy),
comparing with the generic version, this implementation could reduce the
runtime as following:

Name              Percent of rutime reduced
strcpy-aligned    8%-45%
strcpy-unaligned  8%-48%, comparing with the aligned version, unaligned
                  version takes less instructions to copy the tail of data
		  which length is less than 8. it also has better performance
		  in case src and dest cannot be both aligned with 8bytes
strcpy-lsx        20%-80%
strcpy-lasx       15%-86%
stpcpy-aligned    6%-43%
stpcpy-unaligned  8%-48%
stpcpy-lsx        10%-80%
stpcpy-lasx       10%-87%
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to glibc strcpy and stpcpy microbenchmark test results(changed
to use generic_strcpy and generic_stpcpy instead of strlen + memcpy),
comparing with the generic version, this implementation could reduce the
runtime as following:

Name              Percent of rutime reduced
strcpy-aligned    8%-45%
strcpy-unaligned  8%-48%, comparing with the aligned version, unaligned
                  version takes less instructions to copy the tail of data
		  which length is less than 8. it also has better performance
		  in case src and dest cannot be both aligned with 8bytes
strcpy-lsx        20%-80%
strcpy-lasx       15%-86%
stpcpy-aligned    6%-43%
stpcpy-unaligned  8%-48%
stpcpy-lsx        10%-80%
stpcpy-lasx       10%-87%
</pre>
</div>
</content>
</entry>
<entry>
<title>LoongArch: Replace deprecated $v0 with $a0 to eliminate 'as' Warnings.</title>
<updated>2023-09-15T01:07:47+00:00</updated>
<author>
<name>caiyinyu</name>
<email>caiyinyu@loongson.cn</email>
</author>
<published>2023-09-14T11:48:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=c6c73e136a51d2372d108fb411e8418593aa79ca'/>
<id>c6c73e136a51d2372d108fb411e8418593aa79ca</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
