You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function libc::mmap returns a 64-bit address, which is directly used by several memory-related functions (e.g., shmat, mmap, etc.). However, when libc::mmap fails, its return value is not properly distinguished from a valid address.
Currently, the failure return value is treated as a regular u64 address. Since libc::mmap returns an error code in the same value space, this can lead to incorrect handling (e.g., interpreting an error code as a valid 64-bit address), which causes incorrect behavior or crashes.
We can adopt the same approach used in glibc/lind_syscall/lind_syscall.c to treat any return value that is not page-aligned as errno.