tree-wide: explicitly unpoison getdents64() memory
Apparently memory sanitizer doesn't grok getdents64() properly. Let's address that by explicitly marken memory initialized by getdents64() as unpoisoned.
This commit is contained in:
@@ -60,6 +60,8 @@ int readdir_all(int dir_fd,
|
||||
if (n == 0)
|
||||
break;
|
||||
|
||||
msan_unpoison((uint8_t*) de->buffer + de->buffer_size, n);
|
||||
|
||||
de->buffer_size += n;
|
||||
|
||||
if (de->buffer_size < bs - DIRENT_SIZE_MAX) /* Still room for one more entry, then try to
|
||||
|
||||
@@ -103,6 +103,8 @@ int dir_is_empty_at(int dir_fd, const char *path) {
|
||||
if (n < 0)
|
||||
return -errno;
|
||||
|
||||
msan_unpoison(&buffer, n);
|
||||
|
||||
FOREACH_DIRENT_IN_BUFFER(de, &buffer.de, n)
|
||||
if (!dot_or_dot_dot(de->d_name))
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user