Thread (5 messages) 5 messages, 5 authors, 2019-09-09

Re: [PATCH v2 0/5] Add support for O_MAYEXEC

From: Steve Grubb <hidden>
Date: 2019-09-06 19:07:28
Also in: linux-api, linux-fsdevel, lkml

Possibly related (same subject, not in this thread)

On Friday, September 6, 2019 2:57:00 PM EDT Florian Weimer wrote:
* Steve Grubb:
quoted
Now with LD_AUDIT
$ LD_AUDIT=/home/sgrubb/test/openflags/strip-flags.so.0 strace ./test
2>&1 | grep passwd openat(3, "passwd", O_RDONLY)           = 4

No O_CLOEXEC flag.
I think you need to explain in detail why you consider this a problem.
Because you can strip the O_MAYEXEC flag from being passed into the kernel. 
Once you do that, you defeat the security mechanism because it never gets 
invoked. The issue is that the only thing that knows _why_ something is being 
opened is user space. With this mechanism, you can attempt to pass this 
reason to the kernel so that it may see if policy permits this. But you can 
just remove the flag.

-Steve
With LD_PRELOAD and LD_AUDIT, you can already do anything, including
scanning other loaded objects for a system call instruction and jumping
to that (in case a security module in the kernel performs a PC check to
confer additional privileges).

Thanks,
Florian


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help