[PATCH] [msan] Intercept *getxattr and *listxattr.

Evgeniy Stepanov eugenis at google.com
Wed Jan 29 10:41:46 PST 2014


  It would be nice to reuse some code, but we must be careful. A lot of syscalls have subtle difference in semantics with libc wrappers, especially in return value.

  Looks like your wrappers are still incorrect. As I understood from man pages, these functions return the desired buffer size, which may be larger than allocated size. The wording is not clear, please verify. In that case we need to write max(size, res), or something like that.

  In general, we write interceptors defensively, verifying that arguments make sense even if the doc says they must. Man pages are not specs, they are often wrong; and not everyone codes to specs.

  It might be a good idea to move checks inside INTERCEPTOR_WRITE_RANGE / INTERCEPTOR_READ_RANGE in another refactoring CL.

http://llvm-reviews.chandlerc.com/D2642



More information about the llvm-commits mailing list