Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[Q] eCryptFS race window?

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


gorcunov at gmail

May 20, 2008, 10:03 AM

Post #1 of 4 (278 views)
Permalink
[Q] eCryptFS race window?

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 -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


mhalcrow at us

May 20, 2008, 11:27 AM

Post #2 of 4 (269 views)
Permalink
Re: [Q] eCryptFS race window? [In reply to]

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


gorcunov at gmail

May 20, 2008, 11:39 AM

Post #3 of 4 (263 views)
Permalink
Re: [Q] eCryptFS race window? [In reply to]

[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 -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


gorcunov at gmail

May 20, 2008, 11:54 AM

Post #4 of 4 (271 views)
Permalink
Re: [Q] eCryptFS race window? [In reply to]

[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 -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.