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:
Lennart Poettering
2021-10-25 21:51:37 +02:00
parent bfc569b060
commit 0dbce03c37
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -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
+2
View File
@@ -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;