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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 29 Aug 2011 20:51:51 +0300
From:	"Winkler, Tomas" <tomas.winkler@...el.com>
To:	Alexey Khoroshilov <khoroshilov@...ras.ru>,
	Greg Kroah-Hartman <gregkh@...e.de>
CC:	Mike Thomas <rmthomas@...olus.org>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"ldv-project@...ras.ru" <ldv-project@...ras.ru>
Subject: RE: [PATCH] staging/easycap: fix mismatch in easycap_poll() mutex
 lock-unlock



> -----Original Message-----
> From: Alexey Khoroshilov [mailto:khoroshilov@...ras.ru]
> Sent: Monday, August 29, 2011 8:47 PM
> To: Greg Kroah-Hartman
> Cc: Alexey Khoroshilov; Winkler, Tomas; Mike Thomas;
> devel@...verdev.osuosl.org; linux-kernel@...r.kernel.org; ldv-
> project@...ras.ru
> Subject: [PATCH] staging/easycap: fix mismatch in easycap_poll() mutex lock-
> unlock
> 
> In case if condition (kd != isdongle(peasycap)) becomes true,
> easycap_poll() returns without releasing
> easycapdc60_dongle[kd].mutex_video.
> The patch adds mutex_unlock() before that return.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>


Looks correct, thanks
Tomas

> ---
>  drivers/staging/easycap/easycap_main.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/easycap/easycap_main.c
> b/drivers/staging/easycap/easycap_main.c
> index bea2816..3ea51c3 100644
> --- a/drivers/staging/easycap/easycap_main.c
> +++ b/drivers/staging/easycap/easycap_main.c
> @@ -953,8 +953,10 @@ static unsigned int easycap_poll(struct file *file,
> poll_table *wait)
>  	 *  peasycap, IN WHICH CASE A REPEAT CALL TO isdongle() WILL FAIL.
>  	 *  IF NECESSARY, BAIL OUT.
>  	 */
> -		if (kd != isdongle(peasycap))
> +		if (kd != isdongle(peasycap)) {
> +
> 	mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
>  			return -ERESTARTSYS;
> +		}
>  		if (!file) {
>  			SAY("ERROR:  file is NULL\n");
> 
> 	mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
> --
> 1.7.4.1

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ