casaroli commented on code in PR #21358:
URL: https://github.com/apache/nuttx/pull/21358#discussion_r4448852348
##########
mm/kasan/sw_tags.c:
##########
@@ -68,6 +66,17 @@ static spinlock_t g_lock;
* Private Functions
****************************************************************************/
+static inline uint8_t kasan_random_tag(void)
+{
+ /* Use a simple LCG that does not depend on TLS (rand() requires
Review Comment:
The comment says rand() needs a per-task seed in TLS. On master, rand() uses
the global `g_randstate` in libs/libc/stdlib/lib_srand.c and does not read TLS,
so it cannot crash at early boot.
Fix: correct the comment and the commit message: the real gain is that KASAN
no longer changes the rand() sequence of the application.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]