casaroli commented on code in PR #21358:
URL: https://github.com/apache/nuttx/pull/21358#discussion_r4646154079
##########
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:
On master, rand() does not read TLS: it is `nrand_r(limit, &g_randstate)`
with a global state (libs/libc/stdlib/lib_srand.c:117), and `ta_rand_seed` does
not exist in the tree. So it works before TLS exists, and qemu-armv8a:sw_tags
on master boots to NSH.
Fix: keep the LCG, and say in the comment and in the commit message what it
changes on master: 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]