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

   
   ## Summary
   
   - Hard-drop non-root NSH logins with setres*(uid,uid,uid); soft-drop from 
root-originated sessions keeps saved-root.
   - Wire su / sudo to prctl(PR_NSHCRED_AUTHSETEID) for password verify + 
euid/egid raise; enable the agent with PR_NSHCRED_ENABLE at NSH init.
   - Improve useradd UID allocation (passwd_append next UID ≥ 1000) and expand 
ostest multiuser coverage for AUTHSETEID / hard-drop paths.
   - Depends on the companion nuttx PR 
https://github.com/apache/nuttx/pull/19767
   
   ## Impact
   
   NSH sessions can drop to a real non-root identity and escalate only after an 
in-kernel passwd check, which is what makes su/sudo usable with hard-dropped 
logins. Builds without` CONFIG_SCHED_USER_IDENTITY` are unchanged. 
   
   ## Testing
   
   ```
   nsh# useradd testuser UserPass1!
   nsh# cat /tmp/passwd
   
root:$pbkdf2-sha256$10000$uwK3GNfobksYkqa5H9-Rcw$kNsxMZi26PeLxdWKgFjNvZpOoouP_DcHyO2mwyACVc0:0:0:/
   
testuser:$pbkdf2-sha256$10000$LCsDACzp0RA26xvaHPsY2g$gfCJXfLINNOKNIpVqepoUaYJiMbB8ojezAlosZJnrXY:1000:1000:/
   nsh# su testuser
   nsh$ id
   uid=1000(testuser) suid=0(root) gid=1000 sgid=0(root) groups=1000
   nsh$ su root
   password: 
   nsh# id
   uid=0(root) gid=0(root) groups=0(root)
   nsh# 
   ```
   
   
   


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