RTEMS | posix/mmap: Fix validation order for map_fixed addresses (!542)

Kinsey Moore (@opticron) gitlab at rtems.org
Thu Jul 10 22:43:49 UTC 2025




Kinsey Moore started a new discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/542#note_126314


The pointer is not being dereferenced, so these two checks are fine in either order and produce the same result. They also happen to be mutually exclusive. A null pointer can't trip the page mask check and a pointer with the page bits set can't trip the null pointer check.

Masking off bits of a potentially-null pointer isn't undefined behavior, is it?

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/542#note_126314
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250710/d56a8cf5/attachment.htm>


More information about the bugs mailing list