[llvm-bugs] [Bug 27673] New: [ASan] False alarm to recv/recvfrom

via llvm-bugs llvm-bugs at lists.llvm.org
Sat May 7 01:01:08 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27673

            Bug ID: 27673
           Summary: [ASan] False alarm to recv/recvfrom
           Product: compiler-rt
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: laszio at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

ASan checks the return value of real recv/recvfrom to see if the written bytes
fit in the buffer:

https://github.com/llvm-mirror/compiler-rt/commit/c06094fbd7e254dc8ebf03f02d0e9935896829fe

That works fine most of time. However, there is an exception: (from the RECV(2)
man page)

MSG_TRUNC (since Linux 2.2)
    ... return the real length of the packet or datagram, even when it was
longer than the passed buffer. ...

Some programs combine MSG_TRUNK, MSG_PEEK and a single-byte buffer to peek the
incoming data size without reading (much of) them. In this case, the return
value is usually longer than what's been written and ASan raises a false alarm
here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160507/426b466b/attachment.html>


More information about the llvm-bugs mailing list