[PATCH] D42630: Add msan interceptors for readlinkat and name_to_handle_at

Oliver Chang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 16:23:43 PST 2018


oliverchang added inline comments.


================
Comment at: lib/msan/msan_interceptors.cc:150
 
+INTERCEPTOR(SSIZE_T, readlinkat, int dirfd, const char *path, char *buf,
+            SIZE_T bufsiz) {
----------------
eugenis wrote:
> krytarowski wrote:
> > Can push this interceptor to the generic code for all sanitizers?
> Ideally, both interceptors should be in sanitizer_common.
Done, but I'm not sure where to move the tests (if I need to add all).


================
Comment at: lib/msan/msan_interceptors.cc:1050
+      &sanitizer_handle->handle_bytes, sizeof(sanitizer_handle->handle_bytes));
+
+  int res = REAL(name_to_handle_at)(dirfd, pathname, handle, mount_id, flags);
----------------
vitalybuka wrote:
> Maybe intercept open_by_handle_at as well?
> 
Done, but not sure how to test it since it requires CAP_DAC_READ_SEARCH


================
Comment at: lib/sanitizer_common/sanitizer_platform_interceptors.h:449
+#define SANITIZER_INTERCEPT_READLINK SI_POSIX
+#define SANITIZER_INTERCEPT_READLINKAT SI_POSIX
+
----------------
have a questions here: what happens when a function doesn't exist on a particular platform? it seems like readlinkat support was added fairly recently to certain platforms (e.g. added in MacOS 10.10) and may not be available everywhere despite it being part of posix.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D42630





More information about the llvm-commits mailing list