public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/25487] sinl() stack corruption from crafted input (CVE-2020-10029)
[not found] <bug-25487-131@http.sourceware.org/bugzilla/>
@ 2020-03-16 16:54 ` cvs-commit at gcc dot gnu.org
2020-03-16 16:54 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-03-16 16:54 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=25487
--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.29/master branch has been updated by Patricia Franklin
<patsy@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0474cd5de60448f31d7b872805257092faa626e4
commit 0474cd5de60448f31d7b872805257092faa626e4
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Feb 12 23:31:56 2020 +0000
Avoid ldbl-96 stack corruption from range reduction of pseudo-zero (bug
25487).
Bug 25487 reports stack corruption in ldbl-96 sinl on a pseudo-zero
argument (an representation where all the significand bits, including
the explicit high bit, are zero, but the exponent is not zero, which
is not a valid representation for the long double type).
Although this is not a valid long double representation, existing
practice in this area (see bug 4586, originally marked invalid but
subsequently fixed) is that we still seek to avoid invalid memory
accesses as a result, in case of programs that treat arbitrary binary
data as long double representations, although the invalid
representations of the ldbl-96 format do not need to be consistently
handled the same as any particular valid representation.
This patch makes the range reduction detect pseudo-zero and unnormal
representations that would otherwise go to __kernel_rem_pio2, and
returns a NaN for them instead of continuing with the range reduction
process. (Pseudo-zero and unnormal representations whose unbiased
exponent is less than -1 have already been safely returned from the
function before this point without going through the rest of range
reduction.) Pseudo-zero representations would previously result in
the value passed to __kernel_rem_pio2 being all-zero, which is
definitely unsafe; unnormal representations would previously result in
a value passed whose high bit is zero, which might well be unsafe
since that is not a form of input expected by __kernel_rem_pio2.
Tested for x86_64.
(cherry picked from commit 9333498794cde1d5cca518badf79533a24114b6f)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug math/25487] sinl() stack corruption from crafted input (CVE-2020-10029)
[not found] <bug-25487-131@http.sourceware.org/bugzilla/>
2020-03-16 16:54 ` [Bug math/25487] sinl() stack corruption from crafted input (CVE-2020-10029) cvs-commit at gcc dot gnu.org
@ 2020-03-16 16:54 ` cvs-commit at gcc dot gnu.org
2020-08-12 4:51 ` huzaifas at redhat dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-03-16 16:54 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=25487
--- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.29/master branch has been updated by Patricia Franklin
<patsy@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8e5d591b101d7d8a4628522f1e5ec24b6dfa731b
commit 8e5d591b101d7d8a4628522f1e5ec24b6dfa731b
Author: Florian Weimer <fweimer@redhat.com>
Date: Thu Feb 13 17:01:15 2020 +0100
math/test-sinl-pseudo: Use stack protector only if available
This fixes commit 9333498794cde1d5cca518bad ("Avoid ldbl-96 stack
corruption from range reduction of pseudo-zero (bug 25487).").
(cherry picked from commit c10acd40262486dac597001aecc20ad9d3bd0e4a)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug math/25487] sinl() stack corruption from crafted input (CVE-2020-10029)
[not found] <bug-25487-131@http.sourceware.org/bugzilla/>
2020-03-16 16:54 ` [Bug math/25487] sinl() stack corruption from crafted input (CVE-2020-10029) cvs-commit at gcc dot gnu.org
2020-03-16 16:54 ` cvs-commit at gcc dot gnu.org
@ 2020-08-12 4:51 ` huzaifas at redhat dot com
2020-08-19 1:38 ` dominik.b.czarnota+bugzilla at gmail dot com
2021-09-21 0:53 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: huzaifas at redhat dot com @ 2020-08-12 4:51 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=25487
Huzaifa Sidhpurwala <huzaifas at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |huzaifas at redhat dot com
--- Comment #8 from Huzaifa Sidhpurwala <huzaifas at redhat dot com> ---
Looking at the way crash is caused via pseudo-zero numbers and after running
the poc through gdb, it seems like on systems in which glibc is not compiled
with -fstack-protector-all, (which means the vuln function is not protected by
stack-canaries), all that can be achieved is overwrite the stack and the return
address with 0's.
This can only cause a crash and jumping any other location seems very difficult
to achieve if not impossible.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug math/25487] sinl() stack corruption from crafted input (CVE-2020-10029)
[not found] <bug-25487-131@http.sourceware.org/bugzilla/>
` (2 preceding siblings ...)
2020-08-12 4:51 ` huzaifas at redhat dot com
@ 2020-08-19 1:38 ` dominik.b.czarnota+bugzilla at gmail dot com
2021-09-21 0:53 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: dominik.b.czarnota+bugzilla at gmail dot com @ 2020-08-19 1:38 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=25487
Disconnect3d <dominik.b.czarnota+bugzilla at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dominik.b.czarnota+bugzilla
| |@gmail.com
--- Comment #9 from Disconnect3d <dominik.b.czarnota+bugzilla at gmail dot com> ---
(In reply to Guido Vranken from comment #0)
> This has been tested on x64 Linux with both the Ubuntu glibc and the
> latest git glibc.
Btw since Ubuntu 18.04 and 20.04 both seems patched as of today, if anyone
wants to play with this, it can be reproduced on e.g. gcc:9.3 docker image
(https://hub.docker.com/layers/gcc/library/gcc/9.3/images/sha256-dd7c100e12ddbf4178f5cd524a869fa54f453d35bf1b5f287ec6b70e3230c2e4?context=explore),
or by using the following docker image
(https://hub.docker.com/layers/disconnect3d/repro-cve-2020-10029/latest/images/sha256-0d7cf62eee140c9a0039945f8fe2ff3c53b7670b663cb67feef57878ab92ee06?context=explore)
and command where I compiled the example in the cve-2020-10029 directory:
docker run --rm -it --cap-drop=ALL --net=none disconnect3d/repro-cve-2020-10029
/cve-2020-10029/a.out
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug math/25487] sinl() stack corruption from crafted input (CVE-2020-10029)
[not found] <bug-25487-131@http.sourceware.org/bugzilla/>
` (3 preceding siblings ...)
2020-08-19 1:38 ` dominik.b.czarnota+bugzilla at gmail dot com
@ 2021-09-21 0:53 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-21 0:53 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=25487
--- Comment #10 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.27/master branch has been updated by Dmitry Levin
<ldv@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=59420258afaf73dc8fab63ce186bac792613fe08
commit 59420258afaf73dc8fab63ce186bac792613fe08
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Feb 12 23:31:56 2020 +0000
Avoid ldbl-96 stack corruption from range reduction of pseudo-zero (bug
25487).
Bug 25487 reports stack corruption in ldbl-96 sinl on a pseudo-zero
argument (an representation where all the significand bits, including
the explicit high bit, are zero, but the exponent is not zero, which
is not a valid representation for the long double type).
Although this is not a valid long double representation, existing
practice in this area (see bug 4586, originally marked invalid but
subsequently fixed) is that we still seek to avoid invalid memory
accesses as a result, in case of programs that treat arbitrary binary
data as long double representations, although the invalid
representations of the ldbl-96 format do not need to be consistently
handled the same as any particular valid representation.
This patch makes the range reduction detect pseudo-zero and unnormal
representations that would otherwise go to __kernel_rem_pio2, and
returns a NaN for them instead of continuing with the range reduction
process. (Pseudo-zero and unnormal representations whose unbiased
exponent is less than -1 have already been safely returned from the
function before this point without going through the rest of range
reduction.) Pseudo-zero representations would previously result in
the value passed to __kernel_rem_pio2 being all-zero, which is
definitely unsafe; unnormal representations would previously result in
a value passed whose high bit is zero, which might well be unsafe
since that is not a form of input expected by __kernel_rem_pio2.
Tested for x86_64.
(cherry picked from commit 9333498794cde1d5cca518badf79533a24114b6f)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-09-21 0:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-25487-131@http.sourceware.org/bugzilla/>
2020-03-16 16:54 ` [Bug math/25487] sinl() stack corruption from crafted input (CVE-2020-10029) cvs-commit at gcc dot gnu.org
2020-03-16 16:54 ` cvs-commit at gcc dot gnu.org
2020-08-12 4:51 ` huzaifas at redhat dot com
2020-08-19 1:38 ` dominik.b.czarnota+bugzilla at gmail dot com
2021-09-21 0:53 ` cvs-commit at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).