[Bug stdio/20081] New: Check buffer size in getline

fweimer at redhat dot com sourceware-bugzilla@sourceware.org
Thu May 12 14:55:00 GMT 2016


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

            Bug ID: 20081
           Summary: Check buffer size in getline
           Product: glibc
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
        Depends on: 20080
  Target Milestone: ---
             Flags: security-

The functionality bug 20080 will allow us to add additional consistency checks
to getline: malloc_usable_size will check that we indeed got an object pointer,
and we can compare the returned size with the buffer size specified by the
application.

Care needs to be taking that the check is only performed if neither or both
malloc and malloc_usable_size have been interposed.

This probably needs to be guarded by a symbol versioning because we have
existing getline callers which pass it a non-heap buffer (which is an
application bug, but currently works as long as the buffer is large enough), or
pass an invalid pointer with size 0 (see bug 19464).


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=20080
[Bug 20080] Perform heap consistency check in malloc_usable_size
-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list