xiaoxiang781216 commented on code in PR #14052:
URL: https://github.com/apache/nuttx/pull/14052#discussion_r1795631542


##########
mm/kasan/sw_tags.c:
##########
@@ -43,7 +43,7 @@
   (FAR void *)((((uint64_t)(addr)) & ~((uint64_t)0xff << KASAN_TAG_SHIFT)) | \
                (((uint64_t)(tag)) << KASAN_TAG_SHIFT))
 
-#define kasan_random_tag() (rand() % ((1 << (64 - KASAN_TAG_SHIFT)) - 1))
+#define kasan_random_tag() (1 + rand() % ((1 << (64 - KASAN_TAG_SHIFT)) - 1))

Review Comment:
   may result to 256 and mask to 0



##########
mm/kasan/sw_tags.c:
##########
@@ -103,6 +103,11 @@ kasan_is_poisoned(FAR const void *addr, size_t size)
   uint8_t tag;
 
   tag = kasan_get_tag(addr);
+  if (tag == 0x00)

Review Comment:
   ```suggestion
     if (tag == 0)
   ```



-- 
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]

Reply via email to