[PATCH] D117793: Fix for spurious UBSan reports when no file descriptors are available.

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 10:25:38 PST 2022


rengolin added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp:278
   if (pipe(sock_pair))
-    return false;
+    return errno == EMFILE || errno == ENFILE;
   uptr bytes_written =
----------------
This just means the pipe failed for a "known" problem, not that the memory range is accessible, which is what the return value means.

If there are no file descriptors left, then this function needs to calculate the accessibility of the memory range in some other way...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117793/new/

https://reviews.llvm.org/D117793



More information about the llvm-commits mailing list