Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145593686
D31510.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
769 B
Referenced Files
None
Subscribers
None
D31510.diff
View Options
diff --git a/sys/libkern/arc4random.c b/sys/libkern/arc4random.c
--- a/sys/libkern/arc4random.c
+++ b/sys/libkern/arc4random.c
@@ -34,6 +34,7 @@
#include <sys/linker.h>
#include <sys/lock.h>
#include <sys/malloc.h>
+#include <sys/msan.h>
#include <sys/mutex.h>
#include <sys/random.h>
#include <sys/smp.h>
@@ -106,6 +107,14 @@
"enabled.\n");
}
+ /*
+ * "key" is intentionally left uninitialized here, so with KMSAN
+ * enabled the arc4random() return value may be marked
+ * uninitialized, leading to spurious reports. Lie to KMSAN to
+ * avoid this situation.
+ */
+ kmsan_mark(key, sizeof(key), KMSAN_STATE_INITED);
+
/* Last ditch effort to inject something in a bad condition. */
cc = get_cyclecount();
SHA256_Init(&ctx);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 22, 10:51 PM (7 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28945358
Default Alt Text
D31510.diff (769 B)
Attached To
Mode
D31510: arc4random: Avoid KMSAN false positives from pre-seeding results
Attached
Detach File
Event Timeline
Log In to Comment