Abhishekmishra2808 opened a new pull request, #19118:
URL: https://github.com/apache/nuttx/pull/19118

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   Adds tg_suid and tg_sgid fields to task_group_s to complete the POSIX 
three-field identity model (real, effective, saved-set). Updates 
group_inherit_identity() to propagate the new fields from parent to child task 
group on task creation.
   
   Fixes setuid(), setgid(), seteuid(), and setegid() to implement correct 
POSIX privilege transition logic:
   - Root (euid==0): may set any value; all three IDs updated by setuid/setgid
   - Non-root: may only set effective ID to real or saved value; else EPERM
   
   ## Impact
   
   NuttX currently tracks only real and effective credentials. POSIX credential 
semantics require a saved set-user-ID and saved set-group-ID to support 
temporary privilege dropping and later restoration through seteuid()/setegid().
   
   Adding saved IDs enables the standard privilege transition model used by 
setuid/setgid applications and provides the foundation for complete multi-user 
support. (https://github.com/apache/nuttx/issues/18458)
   
   ## Testing
   
   <img width="877" height="811" alt="image" 
src="https://github.com/user-attachments/assets/ef727dee-0d5f-4fe9-b151-fe5830856c15";
 />
   


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