From dd492f8763f13312c17eb67af33e3e90217a30e1 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Thu, 23 Feb 2023 21:51:45 +0000 Subject: [MemSan] Mark memory objects modified by syscalls as initialised --- tools/ktest-randgen/ktest-randgen.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/ktest-randgen') diff --git a/tools/ktest-randgen/ktest-randgen.cpp b/tools/ktest-randgen/ktest-randgen.cpp index 04cf53e6..9b7260eb 100644 --- a/tools/ktest-randgen/ktest-randgen.cpp +++ b/tools/ktest-randgen/ktest-randgen.cpp @@ -117,6 +117,11 @@ void create_stat(size_t size, struct stat *s) { free(filename); error_exit("%s:%d: Error writing %s\n", __FILE__, __LINE__, filename); } +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) + memset(s, 0, sizeof(struct stat)); +#endif +#endif fstat(fd, s); -- cgit 1.4.1