login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
May
»
20
Re: [PATCH] eCryptFS: fix missed mutex_unlock
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Cyrill Gorcunov
Subject:
Re: [PATCH] eCryptFS: fix missed mutex_unlock
Date: Tuesday, May 20, 2008 - 2:46 am
On Tue, May 20, 2008 at 11:28 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
quoted text
> On Sun, 18 May 2008 18:26:11 +0400 Cyrill Gorcunov <gorcunov@gmail.com> wrote: > >> --- >> >> Ingo, could you please apply it and test? Actually I really doubt if it help >> with the locking problem you pointed. There are two procedures >> in miscrev.c - ecryptfs_miscdev_poll() and ecryptfs_miscdev_read() >> which takes/releases mutexes in a bit strange way... investigating, >> but this patch is needed anyway. >> >> Index: linux-2.6.git/fs/ecryptfs/crypto.c >> =================================================================== >> --- linux-2.6.git.orig/fs/ecryptfs/crypto.c 2008-05-18 16:44:20.000000000 +0400 >> +++ linux-2.6.git/fs/ecryptfs/crypto.c 2008-05-18 17:56:12.000000000 +0400 >> @@ -1903,6 +1903,7 @@ int ecryptfs_get_tfm_and_mutex_for_ciphe >> if (rc) { >> printk(KERN_ERR "Error adding new key_tfm to list; " >> "rc = [%d]\n", rc); >> + mutex_unlock(&key_tfm_list_mutex); >> goto out; >> } >> } > > Better to do it this way, I think: > > --- a/fs/ecryptfs/crypto.c~ecryptfs-fix-missed-mutex_unlock > +++ a/fs/ecryptfs/crypto.c > @@ -1906,9 +1906,9 @@ int ecryptfs_get_tfm_and_mutex_for_ciphe > goto out; > } > } > - mutex_unlock(&key_tfm_list_mutex); > (*tfm) = key_tfm->key_tfm; > (*tfm_mutex) = &key_tfm->key_tfm_mutex; > out: > + mutex_unlock(&key_tfm_list_mutex); > return rc; > } > _ > > Holding the lock for an additional few instructions may not be strictly > needed, but we might avoid the reintroduction of such bugs? > >
Good idea, thanks! Could you update the patch, please? --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] eCryptFS: fix missed mutex_unlock
, Cyrill Gorcunov
, (Sun May 18, 7:26 am)
Re: [PATCH] eCryptFS: fix missed mutex_unlock
, Andrew Morton
, (Tue May 20, 12:28 am)
Re: [PATCH] eCryptFS: fix missed mutex_unlock
, Cyrill Gorcunov
, (Tue May 20, 2:46 am)
Re: [PATCH] eCryptFS: fix missed mutex_unlock
, Ingo Molnar
, (Wed May 21, 1:02 am)
Re: [PATCH] eCryptFS: fix missed mutex_unlock
, Cyrill Gorcunov
, (Wed May 21, 2:33 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Pekka Enberg
Re: BUG in free_block (tainted)
Jakub Narebski
Re: [PATCH] gitweb: Fix shortlog only showing HEAD revision.
Rafael J. Wysocki
[Bug #16136] Linux 2.6.34 causes system lockup on Compaq Presario 2200 Laptop
Joerg Roedel
Re: [patch] dma-debug: off by one issue
Tetsuo Handa
Re: [AppArmor #7 0/13] AppArmor security module
git
:
Junio C Hamano
Re: [RFC] origin link for cherry-pick and revert
Christian Stimming
git-gui: Fix broken revert confirmation.
Junio C Hamano
Re: git-svnimport
Mark Burton
Re: [PATCH] builtin-branch: highlight current remote branches with an asterisk
Henk
Announcement: Git Extensions stable (windows shell extensions)
linux-netdev
:
Nick Piggin
Re: Kernel WARNING: at net/core/dev.c:1330 __netif_schedule+0x2c/0x98()
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Amit Kumar Salecha
[PATCH NEXT 10/10] qlcnic: add cksum flag
Julius Volz
[PATCH] IRDA: Fix genlmsg_put() return value check.
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
cpumask: make irq_set_affinity() take a const struct cpumask
Linux Kernel Mailing List
virtio_blk: implement naming for vda-vdz,vdaa-vdzz,vdaaa-vdzzz
Linux Kernel Mailing List
[POWERPC] Use of_register_driver to implement of_register_platform_driver
Linux Kernel Mailing List
V4L/DVB (9041): Add support YUAN High-Tech STK7700D (1164:1f08)
openbsd-misc
:
Ryan McBride
Re: Packets Per Second Limit?
Stuart Henderson
Re: SquidGuard problem
Henning Brauer
Re: 3ware hardware raid support?
Nick Guenther
Re: Encrypting home partition
nixlists
Re: Openssl patch breaks Tor
Colocation donated by:
Syndicate