diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2018-11-10 09:10:49 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-11-10 11:58:09 +0100 |
commit | 313992dfb58ab0ca2d1ab33a3f450fd772069605 (patch) | |
tree | 78fea9865cc03eb504333c5614ae05cb9d3d1efa /src | |
parent | b0395ac5cdce48af0d946f5d107e2f794c2ecf43 (diff) | |
download | systemd-313992dfb58ab0ca2d1ab33a3f450fd772069605.tar.gz |
basic: make rdrand64 a little bit more MSAn-friendly
MSan doesn't instrument inline asm calls so let's help it
by marking err as initialized manually.
Fixes: https://github.com/systemd/systemd/issues/10714.
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/random-util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/basic/random-util.c b/src/basic/random-util.c index 8eb6acfbbf..c17c09765b 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -30,6 +30,9 @@ #include "random-util.h" #include "time-util.h" +#if HAS_FEATURE_MEMORY_SANITIZER +#include <sanitizer/msan_interface.h> +#endif int rdrand64(uint64_t *ret) { @@ -56,6 +59,11 @@ int rdrand64(uint64_t *ret) { "setc %1" : "=r" (*ret), "=qm" (err)); + +#if HAS_FEATURE_MEMORY_SANITIZER + __msan_unpoison(&err, sizeof(err)); +#endif + if (!err) return -EAGAIN; |