Re: [RFC PATCH v1 0/2] Add O_DENY_WRITE (complement AT_EXECVE_CHECK)

From
Theodore Ts'o <tytso@mit.edu>
Date
2025-08-26 20:53:06
Also in
linux-fsdevel, linux-integrity, linux-security-module, lkml
Reply to
Mickaël Salaün, 2025-08-26
On Tue, Aug 26, 2025 at 07:47:30PM +0200, Mickaël Salaün wrote:
  Passing the AT_EXECVE_CHECK flag to execveat(2) only performs a check
  on a regular file and returns 0 if execution of this file would be
  allowed, ignoring the file format and then the related interpreter
  dependencies (e.g. ELF libraries, script’s shebang).
But if that's it, why can't the script interpreter (python, bash,
etc.) before executing the script, checks for executability via
faccessat(2) or fstat(2)?

The whole O_DONY_WRITE dicsussion seemed to imply that AT_EXECVE_CHECK
was doing more than just the executability check?
There is no other way for user space to reliably check executability of
files (taking into account all enforced security
policies/configurations).
Why doesn't faccessat(2) or fstat(2) suffice?  This is why having a
more substantive requirements and design doc might be helpful.  It
appears you have some assumptions that perhaps other kernel developers
are not aware.  I certainly seem to be missing something.....

    		  	    	    - Ted
Thread (36 messages) 36 messages, 11 authors, last reply 2025-09-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help