[RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
2017-09-29 03:26:15
Also in
linux-fsdevel, linux-integrity, lkml
Reply to
Mimi Zohar, 2017-09-29
On Thu, Sep 28, 2017 at 6:53 PM, Mimi Zohar [off-list ref] wrote:
The locking issue isn't with validating the file hash, but with the
setxattr, chmod, chown syscalls.  Each of these syscalls takes the
i_rwsem exclusively before IMA (or EVM) is called.
Read my email again.
In setxattr, chmod, chown syscalls, IMA (and EVM) are called after the
i_rwsem is already taken.  So the locking would be:

lock: i_rwsem
lock: iint->mutex
No.

Two locks. One inner, one outer. Only the actual ones that calculates
the hash would take the outer one. Read my email.

           Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (13 messages) 13 messages, 4 authors, last reply 2017-09-29
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