casaroli opened a new pull request, #20762: URL: https://github.com/apache/nuttx/pull/20762
## Summary `mount()` accepted `MS_NOEXEC`, but ignored it. Nothing kept the flag, so a file on such a mount looked executable. This PR keeps `MS_NOEXEC` in the flags of the mount point inode (a new bit, `FSNODEFLAG_NOEXEC`), and clears it on `umount()`. `stat()`, `lstat()` and `fstat()` then report the regular files of the mount without execute permission. Directories keep their search permission. The second commit says in the `mount()` description which flags have an effect. ## Impact Only a mount with `MS_NOEXEC` changes. Nothing else checks the execute bits today; with the execute permission check of #NNNNN, such a file cannot be started. ## Testing A test program on `qemu-armv8a:knsh` (QEMU 11 with HVF on an Apple M4) with tmpfs mounts: | Check | master | this PR | |---|---|---| | file on a mount with `MS_NOEXEC`, `stat()` and `fstat()` | `0777` | `0666` | | directory on that mount | `0777` | `0777` | | file on a mount without `MS_NOEXEC` | `0777` | `0777` | | file after `umount()` and a mount without `MS_NOEXEC` at the same place | `0777` | `0777` | `ostest` on `qemu-armv8a:knsh` and `qemu-armv8a:nsh` gives the same result as master (it stops only at `rr_test`, which fails on master too when the host is busy). `tools/checkpatch.sh -c -u -m -g` passes. -- 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]
