public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/15002] New: Avoid undefined behavior in posix_fallocate overflow check
@ 2013-01-08  4:58 nickolai at csail dot mit.edu
  2013-05-15  9:43 ` [Bug libc/15002] " ondra at iuuk dot mff.cuni.cz
  2014-06-13 19:08 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: nickolai at csail dot mit.edu @ 2013-01-08  4:58 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=15002

             Bug #: 15002
           Summary: Avoid undefined behavior in posix_fallocate overflow
                    check
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: nickolai@csail.mit.edu
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


Created attachment 6802
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6802
proposed fix

posix_fallocate relies on wraparound to check whether offset + len overflows. 
As both are signed values, this is undefined behavior in C, and some compilers
(e.g., gcc-4.7.2) will optimize away the if (offset + len < 0) check as dead
code, since it is already known that offset >= 0 and len >= 0.  The attached
patch replaces the check with one that does not rely on undefined behavior.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/15002] Avoid undefined behavior in posix_fallocate overflow check
  2013-01-08  4:58 [Bug libc/15002] New: Avoid undefined behavior in posix_fallocate overflow check nickolai at csail dot mit.edu
@ 2013-05-15  9:43 ` ondra at iuuk dot mff.cuni.cz
  2014-06-13 19:08 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: ondra at iuuk dot mff.cuni.cz @ 2013-05-15  9:43 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=15002

OndrejBilka <ondra at iuuk dot mff.cuni.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ondra at iuuk dot
                   |                            |mff.cuni.cz

--- Comment #1 from OndrejBilka <ondra at iuuk dot mff.cuni.cz> 2013-05-15 09:42:57 UTC ---
Could you send fix to libc-alpha@sourceware.org?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/15002] Avoid undefined behavior in posix_fallocate overflow check
  2013-01-08  4:58 [Bug libc/15002] New: Avoid undefined behavior in posix_fallocate overflow check nickolai at csail dot mit.edu
  2013-05-15  9:43 ` [Bug libc/15002] " ondra at iuuk dot mff.cuni.cz
@ 2014-06-13 19:08 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13 19:08 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

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


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

end of thread, other threads:[~2014-06-13 19:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-08  4:58 [Bug libc/15002] New: Avoid undefined behavior in posix_fallocate overflow check nickolai at csail dot mit.edu
2013-05-15  9:43 ` [Bug libc/15002] " ondra at iuuk dot mff.cuni.cz
2014-06-13 19:08 ` fweimer at redhat dot com

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).