mirror of
https://github.com/apache/nuttx.git
synced 2026-08-08 14:07:17 +00:00
Require X_OK on path ancestors and mountpoint gates via inode_checkpathperm(), and use inode_checkperm() for inode mode checks. inode_checkpathperm() takes the inode tree read lock (or INODE_CHECK_LOCKED when the caller already holds it) and can fold a non-zero amode check onto the target inode in the same call. When CONFIG_FS_PERMISSION is disabled, inode_checkperm/inode_checkpathperm are empty macros returning 0 so there is no stub .text cost. Skip mountpoint R/W open-mode checks in inode_checkopenperm(); keep traversal separate from open. Add an optional mountpt_operations.permission hook (tmpfs when CONFIG_FS_PERMISSION) for in-volume DAC without making the VFS mount-crossing path depend on it. Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| fs_files.c | ||
| fs_foreachinode.c | ||
| fs_inode.c | ||
| fs_inodeaddref.c | ||
| fs_inodebasename.c | ||
| fs_inodefind.c | ||
| fs_inodefree.c | ||
| fs_inodegetpath.c | ||
| fs_inoderelease.c | ||
| fs_inoderemove.c | ||
| fs_inodereserve.c | ||
| fs_inodesearch.c | ||
| inode.h | ||
| Make.defs | ||