[compiler-rt] Fix GetRandom in sanitizer_fuchsia.cpp (PR #110155)

Marco Vanotti via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 11:31:09 PDT 2024


https://github.com/mvanotti created https://github.com/llvm/llvm-project/pull/110155

The `zx_cprng_draw` system call has no limit on how much you can draw.

>From a2330060f531dfabc064e77d95c39f1393912a5c Mon Sep 17 00:00:00 2001
From: Marco Vanotti <mvanotti at users.noreply.github.com>
Date: Thu, 26 Sep 2024 14:30:32 -0400
Subject: [PATCH] Fix GetRandom in sanitizer_fuchsia.cpp

The `zx_cprng_draw` system call has no limit on how much you can draw.
---
 compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
index 75dcf546729f6e..e8741585059123 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
@@ -518,7 +518,6 @@ uptr ReadLongProcessName(/*out*/ char *buf, uptr buf_len) {
 uptr MainThreadStackBase, MainThreadStackSize;
 
 bool GetRandom(void *buffer, uptr length, bool blocking) {
-  CHECK_LE(length, ZX_CPRNG_DRAW_MAX_LEN);
   _zx_cprng_draw(buffer, length);
   return true;
 }



More information about the llvm-commits mailing list