public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/30983] New: signed integer overflow in glibc/sysdeps/hppa/fpu/fclrexcpt.c
@ 2023-10-18 20:20 bruno at clisp dot org
  2023-10-18 20:21 ` [Bug math/30983] " bruno at clisp dot org
  0 siblings, 1 reply; 2+ messages in thread
From: bruno at clisp dot org @ 2023-10-18 20:20 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 30983
           Summary: signed integer overflow in
                    glibc/sysdeps/hppa/fpu/fclrexcpt.c
           Product: glibc
           Version: 2.38
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: bruno at clisp dot org
  Target Milestone: ---

In glibc/sysdeps/hppa/fpu/fclrexcpt.c line 29:

  s.sw[0] &= ~((excepts & FE_ALL_EXCEPT) << 27);

the expression

  (excepts & FE_ALL_EXCEPT) << 27

produces a signed integer overflow when 'excepts' is specified as FE_INVALID (=
0x10), because
  - excepts is of type 'int',
  - FE_ALL_EXCEPT is of type 'int',
  - thus (excepts & FE_ALL_EXCEPT) is (int) 0x10,
  - 'int' is 32 bits wide.

A possible fix is to change that line to:

  s.sw[0] &= ~((unsigned int) (excepts & FE_ALL_EXCEPT) << 27);

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

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

* [Bug math/30983] signed integer overflow in glibc/sysdeps/hppa/fpu/fclrexcpt.c
  2023-10-18 20:20 [Bug math/30983] New: signed integer overflow in glibc/sysdeps/hppa/fpu/fclrexcpt.c bruno at clisp dot org
@ 2023-10-18 20:21 ` bruno at clisp dot org
  0 siblings, 0 replies; 2+ messages in thread
From: bruno at clisp dot org @ 2023-10-18 20:21 UTC (permalink / raw)
  To: glibc-bugs

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

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=30960
             Target|                            |hppa-unknown-linux-gnu
               Host|                            |hppa-unknown-linux-gnu

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

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

end of thread, other threads:[~2023-10-18 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-18 20:20 [Bug math/30983] New: signed integer overflow in glibc/sysdeps/hppa/fpu/fclrexcpt.c bruno at clisp dot org
2023-10-18 20:21 ` [Bug math/30983] " bruno at clisp 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).