]> 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]>
Wed, 3 Jun 2026 04:02:35 +0000 (01:02 -0300)
commit02d3a2eabf98faabbd5a0d3e20a50816fb4d1671
tree052a2a45f3d46f4cca461571c059dcb5aebd7f63
parentce62d9ce8abbd9bd39a0a0694b96356424ca911c
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