]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
security: Round 5.4 varargs open/openat/fcntl (A17)
authorTulio A M Mendes <[email protected]>
Mon, 25 May 2026 19:15:34 +0000 (16:15 -0300)
committerTulio A M Mendes <[email protected]>
Mon, 25 May 2026 19:15:34 +0000 (16:15 -0300)
commit7a65be564a35035f21a8e0b56701bc8d051718ab
tree3990cde9f42d2538e9d6fb0ae8565b9342097011
parenta8c5818b688c7824bee52231a2d4c02f558044e3
security: Round 5.4 varargs open/openat/fcntl (A17)

A17: Fix varargs handling in open/openat/fcntl
- open: Only read mode from varargs when O_CREAT is set
- openat: Only read mode from varargs when O_CREAT is set
- fcntl: Only read arg from varargs for commands that need it (F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_SETFL, F_DUPFD_CLOEXEC)
- Prevents undefined behavior from reading varargs when not needed

Tests: 119/119 PASS (smoke test, SMP=4)
user/ulibc/src/unistd.c