lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 05 Jan 2015 17:14:05 +0800
From:	"Hillf Danton" <hillf.zj@...baba-inc.com>
To:	"'xiaomin1'" <xiaoming.wang@...el.com>
Cc:	"'Zhang Dongxing'" <dongxing.zhang@...el.com>, <arnd@...db.de>,
	<gregkh@...uxfoundation.org>, <linux-kernel@...r.kernel.org>,
	"Chuansheng Liu" <chuansheng.liu@...el.com>
Subject: Re: [PATCH] move file->f_op->open out of mutex (misc_mtx) in misc_open

> 
> misc_mtx was used to mutex misc_list.
> But file->f_op->open may be blocked by downloading
> firmware in some devices' open.
> So move file->f_op->open out of mutex (misc_mtx)
> in misc_open to avoid this block.
> It also make code more efficiency.
> 
> Signed-off-by: Zhang Dongxing <dongxing.zhang@...el.com>
> Signed-off-by: xiaoming wang <xiaoming.wang@...el.com>
> ---
>  drivers/char/misc.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/misc.c b/drivers/char/misc.c
> index ffa97d2..289c59e 100644
> --- a/drivers/char/misc.c
> +++ b/drivers/char/misc.c
> @@ -144,7 +144,8 @@ static int misc_open(struct inode * inode, struct file * file)
>  	replace_fops(file, new_fops);
>  	if (file->f_op->open) {
>  		file->private_data = c;
> -		err = file->f_op->open(inode,file);
> +		mutex_unlock(&misc_mtx);
> +		return file->f_op->open(inode,file);
>  	}
What if unregister breaks in while opening?

>  fail:
>  	mutex_unlock(&misc_mtx);
> --
> 1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists