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>] [day] [month] [year] [list]
Message-ID: <1828884A29C6694DAF28B7E6B8A82373A903C417@ORSMSX109.amr.corp.intel.com>
Date:	Fri, 18 Sep 2015 16:16:21 +0000
From:	"Hefty, Sean" <sean.hefty@...el.com>
To:	Nicholas Krause <xerofoify@...il.com>,
	"dledford@...hat.com" <dledford@...hat.com>
CC:	"hal.rosenstock@...il.com" <hal.rosenstock@...il.com>,
	"haggaie@...lanox.com" <haggaie@...lanox.com>,
	"jgunthorpe@...idianresearch.com" <jgunthorpe@...idianresearch.com>,
	"Weiny, Ira" <ira.weiny@...el.com>,
	"yun.wang@...fitbricks.com" <yun.wang@...fitbricks.com>,
	"erezsh@...lanox.com" <erezsh@...lanox.com>,
	"ted.h.kim@...cle.com" <ted.h.kim@...cle.com>,
	"david.ahern@...cle.com" <david.ahern@...cle.com>,
	"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] infiniband:core:Fix error handling in the function
 cm_lap_handler

> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
> index ea4db9c..8fab3a7 100644
> --- a/drivers/infiniband/core/cm.c
> +++ b/drivers/infiniband/core/cm.c
> @@ -2812,7 +2812,12 @@ static int cm_lap_handler(struct cm_work *work)
>  	cm_init_av_for_response(work->port, work->mad_recv_wc->wc,
>  				work->mad_recv_wc->recv_buf.grh,
>  				&cm_id_priv->av);
> -	cm_init_av_by_path(param->alternate_path, &cm_id_priv->alt_av);
> +	ret = cm_init_av_by_path(param->alternate_path, &cm_id_priv-
> >alt_av);
> +	if (ret) {
> +		spin_unlock_irq(&cm_id_priv->lock);
> +		cm_deref_id(cm_id_priv);
> +	}

How can this be right?  On a failure, we release the spinlock and the reference on the cm_id, then continue on with the processing?

> +
>  	ret = atomic_inc_and_test(&cm_id_priv->work_count);
>  	if (!ret)
>  		list_add_tail(&work->list, &cm_id_priv->work_list);
> --
> 2.1.4

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