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.
This commit is contained in:
Evgeny Vereshchagin
2018-11-10 11:58:09 +01:00
committed by Lennart Poettering
parent b0395ac5cd
commit 313992dfb5
+8
View File
@@ -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;