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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 26 May 2010 10:55:02 -0700
From:	Andy Grover <andy.grover@...cle.com>
To:	Julia Lawall <julia@...u.dk>
CC:	"David S. Miller" <davem@...emloft.net>, rds-devel@....oracle.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org, Zach Brown <zach.brown@...cle.com>
Subject: Re: [PATCH 1/17] net/rds: Add missing mutex_unlock

Reviewed-by: Zach Brown <zach.brown@...cle.com>
Acked-by: Andy Grover <andy.grover@...cle.com>

-- Andy

On 05/26/2010 08:54 AM, Julia Lawall wrote:
> From: Julia Lawall<julia@...u.dk>
>
> Add a mutex_unlock missing on the error path.  In each case, whenever the
> label out is reached from elsewhere in the function, mutex is not locked.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> //<smpl>
> @@
> expression E1;
> @@
>
> * mutex_lock(E1);
>    <+... when != E1
>    if (...) {
>      ... when != E1
> *   return ...;
>    }
>    ...+>
> * mutex_unlock(E1);
> //</smpl>
>
> Signed-off-by: Julia Lawall<julia@...u.dk>
>
> ---
>   net/rds/ib_cm.c |    1 +
>   net/rds/iw_cm.c |    1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
> index 10ed0d5..f688327 100644
> --- a/net/rds/ib_cm.c
> +++ b/net/rds/ib_cm.c
> @@ -475,6 +475,7 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
>   	err = rds_ib_setup_qp(conn);
>   	if (err) {
>   		rds_ib_conn_error(conn, "rds_ib_setup_qp failed (%d)\n", err);
> +		mutex_unlock(&conn->c_cm_lock);
>   		goto out;
>   	}
>
> diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c
> index a9d951b..b5dd6ac 100644
> --- a/net/rds/iw_cm.c
> +++ b/net/rds/iw_cm.c
> @@ -452,6 +452,7 @@ int rds_iw_cm_handle_connect(struct rdma_cm_id *cm_id,
>   	err = rds_iw_setup_qp(conn);
>   	if (err) {
>   		rds_iw_conn_error(conn, "rds_iw_setup_qp failed (%d)\n", err);
> +		mutex_unlock(&conn->c_cm_lock);
>   		goto out;
>   	}
>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ