lkml.org 
[lkml]   [2014]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] ima: remove unnecessary i_mutex locking
From
Date
On Wed, 2014-06-11 at 20:51 +0300, Dmitry Kasatkin wrote: 
> I think i_mutex locking is absolutely unnecessary here.
> It is uselessly taken here even when IMA policy is empty and
> IMA is effectively disabled.
>
> Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>

Thanks! Please re-post with an appropriate patch description.

Mimi
> ---
> security/integrity/ima/ima_main.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
> index 09baa33..cf1c369 100644
> --- a/security/integrity/ima/ima_main.c
> +++ b/security/integrity/ima/ima_main.c
> @@ -88,8 +88,6 @@ static void ima_rdwr_violation_check(struct file *file)
> if (!S_ISREG(inode->i_mode) || !ima_initialized)
> return;
>
> - mutex_lock(&inode->i_mutex); /* file metadata: permissions, xattr */
> -
> if (mode & FMODE_WRITE) {
> if (atomic_read(&inode->i_readcount) && IS_IMA(inode)) {
> struct integrity_iint_cache *iint;
> @@ -104,8 +102,6 @@ static void ima_rdwr_violation_check(struct file *file)
> send_writers = true;
> }
>
> - mutex_unlock(&inode->i_mutex);
> -
> if (!send_tomtou && !send_writers)
> return;
>




\
 
 \ /
  Last update: 2014-06-12 17:41    [W:0.051 / U:5.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site