* [Q] eCryptFS race window?
@ 2008-05-20 17:03 Cyrill Gorcunov
2008-05-20 18:27 ` Michael Halcrow
0 siblings, 1 reply; 4+ messages in thread
From: Cyrill Gorcunov @ 2008-05-20 17:03 UTC (permalink / raw)
To: Michael A. Halcrow; +Cc: LKML
Hi Michael,
it seems there is a few potential race window in eCryptFS which I was trying
to fix but it requires more deeper eCrypFS knowledge that have (at least only
by understanding eCryptFS in big picture it is possible to fix this problem
by elegant path). So what is the problem - the procedures
ecryptfs_miscdev_poll
ecryptfs_miscdev_read
does take ecryptfs_daemon_hash_mux mutex and then daemon->mux _but_ releases
them not in exactly backward order as it should. My patches (not in mainline
but you saw them) was screwed up 'cause mutex_is_locked could release mutex
acquired by another process and that is wrong. But I've a hope that I'm simply
*wrong* about this possible races ;) Take a look please.
- Cyrill -
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Q] eCryptFS race window?
2008-05-20 17:03 [Q] eCryptFS race window? Cyrill Gorcunov
@ 2008-05-20 18:27 ` Michael Halcrow
2008-05-20 18:39 ` Cyrill Gorcunov
2008-05-20 18:54 ` Cyrill Gorcunov
0 siblings, 2 replies; 4+ messages in thread
From: Michael Halcrow @ 2008-05-20 18:27 UTC (permalink / raw)
To: Cyrill Gorcunov; +Cc: LKML
On Tue, May 20, 2008 at 09:03:21PM +0400, Cyrill Gorcunov wrote:
> it seems there is a few potential race window in eCryptFS which I
> was trying to fix but it requires more deeper eCrypFS knowledge that
> have (at least only by understanding eCryptFS in big picture it is
> possible to fix this problem by elegant path). So what is the
> problem - the procedures
>
> ecryptfs_miscdev_poll
> ecryptfs_miscdev_read
>
> does take ecryptfs_daemon_hash_mux mutex and then daemon->mux _but_
> releases them not in exactly backward order as it should. My patches
> (not in mainline but you saw them) was screwed up 'cause
> mutex_is_locked could release mutex acquired by another process and
> that is wrong. But I've a hope that I'm simply *wrong* about this
> possible races ;) Take a look please.
I cannot find an execution path whereby one of the two must re-acquire
ecryptfs_daemon_hash_mux in order to release daemon->mux, so I do not
think we will ever have deadlock between those two functions.
Mike
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Q] eCryptFS race window?
2008-05-20 18:27 ` Michael Halcrow
@ 2008-05-20 18:39 ` Cyrill Gorcunov
2008-05-20 18:54 ` Cyrill Gorcunov
1 sibling, 0 replies; 4+ messages in thread
From: Cyrill Gorcunov @ 2008-05-20 18:39 UTC (permalink / raw)
To: Michael Halcrow; +Cc: LKML
[Michael Halcrow - Tue, May 20, 2008 at 01:27:57PM -0500]
| On Tue, May 20, 2008 at 09:03:21PM +0400, Cyrill Gorcunov wrote:
| > it seems there is a few potential race window in eCryptFS which I
| > was trying to fix but it requires more deeper eCrypFS knowledge that
| > have (at least only by understanding eCryptFS in big picture it is
| > possible to fix this problem by elegant path). So what is the
| > problem - the procedures
| >
| > ecryptfs_miscdev_poll
| > ecryptfs_miscdev_read
| >
| > does take ecryptfs_daemon_hash_mux mutex and then daemon->mux _but_
| > releases them not in exactly backward order as it should. My patches
| > (not in mainline but you saw them) was screwed up 'cause
| > mutex_is_locked could release mutex acquired by another process and
| > that is wrong. But I've a hope that I'm simply *wrong* about this
| > possible races ;) Take a look please.
|
| I cannot find an execution path whereby one of the two must re-acquire
| ecryptfs_daemon_hash_mux in order to release daemon->mux, so I do not
| think we will ever have deadlock between those two functions.
|
| Mike
|
ok, that means I'm just wrong, thanks
- Cyrill -
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Q] eCryptFS race window?
2008-05-20 18:27 ` Michael Halcrow
2008-05-20 18:39 ` Cyrill Gorcunov
@ 2008-05-20 18:54 ` Cyrill Gorcunov
1 sibling, 0 replies; 4+ messages in thread
From: Cyrill Gorcunov @ 2008-05-20 18:54 UTC (permalink / raw)
To: Michael Halcrow; +Cc: LKML
[Michael Halcrow - Tue, May 20, 2008 at 01:27:57PM -0500]
| On Tue, May 20, 2008 at 09:03:21PM +0400, Cyrill Gorcunov wrote:
| > it seems there is a few potential race window in eCryptFS which I
| > was trying to fix but it requires more deeper eCrypFS knowledge that
| > have (at least only by understanding eCryptFS in big picture it is
| > possible to fix this problem by elegant path). So what is the
| > problem - the procedures
| >
| > ecryptfs_miscdev_poll
| > ecryptfs_miscdev_read
| >
| > does take ecryptfs_daemon_hash_mux mutex and then daemon->mux _but_
| > releases them not in exactly backward order as it should. My patches
| > (not in mainline but you saw them) was screwed up 'cause
| > mutex_is_locked could release mutex acquired by another process and
| > that is wrong. But I've a hope that I'm simply *wrong* about this
| > possible races ;) Take a look please.
|
| I cannot find an execution path whereby one of the two must re-acquire
| ecryptfs_daemon_hash_mux in order to release daemon->mux, so I do not
| think we will ever have deadlock between those two functions.
|
| Mike
|
Anyway, don't apply my patch you've tested (which I've replied to
Ingo's circular dep report), please, it's screwed ;) The patch Andrew
has taken to its tree is ok.
- Cyrill -
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-20 18:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20 17:03 [Q] eCryptFS race window? Cyrill Gorcunov
2008-05-20 18:27 ` Michael Halcrow
2008-05-20 18:39 ` Cyrill Gorcunov
2008-05-20 18:54 ` Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox