public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/26649] New: printf should handle non-normal x86 long double numbers gracefully
@ 2020-09-22 14:24 fweimer at redhat dot com
  2020-09-22 14:25 ` [Bug stdio/26649] " fweimer at redhat dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2020-09-22 14:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=26649

            Bug ID: 26649
           Summary: printf should handle non-normal x86 long double
                    numbers gracefully
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---

The behavior of isnan/__builtin_isnan on bit patterns that do not correspond to
something that the CPU would produce from valid inputs is currently
under-defined in the toolchain. (The GCC built-in and glibc disagree.)

The isnan check in PRINTF_FP_FETCH in stdio-common/printf_fp.c assumes the GCC
behavior that returns true for non-normal numbers which are not specified as
NaN. (The glibc implementation returns false for such numbers.)

At present, passing non-normal numbers to __mppn_extract_long_double causes
this function to produce irregularly shaped multi-precision integers,
triggering undefined behavior in __printf_fp_l.

With GCC 10 and glibc 2.32, this behavior is not visible because
__builtin_isnan is used, which avoids calling __mppn_extract_long_double in
this case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-25 14:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 14:24 [Bug stdio/26649] New: printf should handle non-normal x86 long double numbers gracefully fweimer at redhat dot com
2020-09-22 14:25 ` [Bug stdio/26649] " fweimer at redhat dot com
2020-09-22 14:32 ` fweimer at redhat dot com
2020-09-22 17:15 ` fweimer at redhat dot com
2020-12-04 15:41 ` siddhesh at sourceware dot org
2020-12-06  8:21 ` carnil at debian dot org
2020-12-16  9:49 ` schwab@linux-m68k.org
2020-12-16 10:27 ` [Bug stdio/26649] printf should handle non-normal x86 long double numbers gracefully (CVE-2020-29573) fweimer at redhat dot com
2023-07-25 14:07 ` siddhesh at sourceware dot 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).