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

Sergey Matveev earthdok at google.com
Wed Jan 29 09:46:15 PST 2014



================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:3076
@@ +3075,3 @@
+  SSIZE_T res = REAL(listxattr)(path, list, size);
+  if (res >= 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, list, size);
+  return res;
----------------
Sergey Matveev wrote:
> Sergey Matveev wrote:
> > Evgeniy Stepanov wrote:
> > > if (res  > 0 && list)
> > > 
> > > size => res
> > We should probably fix this also in sanitizer_common_syscalls.inc, then.
> Also, I'm fairly sure res > 0 implies list != NULL.
Ok, looking at the man page it actually says:

"An empty buffer of _size_ zero can be passed into these calls to return the current size of the list of extended attribute names"

So we should not attempt to unpoison if size == 0. (The way this is formulated still doesn't allow list == 0, but it's probably best to check.)


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



More information about the llvm-commits mailing list