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

   ## Summary
   
   This change adds path-search permission checks `(inode_checksearchpath)` so 
every ancestor and mountpoint gate must allow X_OK, and unifies inode mode 
checks on `inode_permission().` Mountpoint open no longer treats directory R/W 
bits as file open modes; traverse stays separate. An optional 
mountpt_operations.permission hook is added for in-volume DAC (tmpfs), without 
making VFS mount-crossing depend on it. Documentation describes the interface 
and mount-crossing behavior.
   
   ## Impact
   
   A private pseudoFS parent can no longer be bypassed by opening paths under a 
filesystem mounted beneath it—non-root access gets EACCES when parent/mount 
traverse is denied. Behavior is unchanged when CONFIG_FS_PERMISSION is off. 
Filesystems that leave permission NULL are unaffected beyond the new VFS 
traverse checks on the mountpoint inode.
   
   ## Testing
   
   ```
   nsh> mkdir /secure
   nsh> mkdir /secure/mnt
   nsh> mount -t tmpfs /secure/mnt
   nsh> echo secret > /secure/mnt/a
   nsh> chmod 0700 /secure
   nsh> stat /secure
   nsh: stat: command not found
   nsh> echo 'root:x:0:0:/' > /tmp/ostest_passwd
   nsh> echo 'testuser:x:1000:1000:/' >> /tmp/ostest_passwd
   nsh> su testuser
   nsh> id
   uid=0 euid=1000 gid=0 egid=1000
   nsh> cat /secure/mnt/a
   nsh: cat: open failed: 13
   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