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]
Message-ID: <47CE3D33.7060805@voltaire.com>
Date:	Wed, 05 Mar 2008 08:26:59 +0200
From:	Erez Zilber <erezz@...taire.com>
To:	Arne Redlich <arne.redlich@...anet.com>,
	Roland Dreier <rolandd@...co.com>
CC:	ofa-general <general@...ts.openfabrics.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] IB/iSER: fix list iteration bug

Arne Redlich wrote:

> Erez Zilber <erezz@...taire.com> writes:
>
>   
>> Arne Redlich wrote:
>>     
>>> The iteration through the list of "iser_device"s during device
>>> lookup/creation is broken - it might result in an infinite loop if more
>>> than 1 HCA is used with iSER. Use list_for_each_entry() instead of the
>>> custom, flawed list iteration code.
>>>
>>> Signed-off-by: Arne Redlich <arne.redlich@...anet.com>
>>> ---
>>>  drivers/infiniband/ulp/iser/iser_verbs.c |   36 ++++++++++++-----------------
>>>  1 files changed, 15 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
>>> index 714b8db..1c0f968 100644
>>> --- a/drivers/infiniband/ulp/iser/iser_verbs.c
>>> +++ b/drivers/infiniband/ulp/iser/iser_verbs.c
>>> @@ -237,33 +237,27 @@ static int iser_free_ib_conn_res(struct iser_conn *ib_conn)
>>>  static
>>>  struct iser_device *iser_device_find_by_ib_device(struct rdma_cm_id *cma_id)
>>>  {
>>> -	struct list_head    *p_list;
>>> -	struct iser_device  *device = NULL;
>>> +	struct iser_device *device;
>>>  
>>>  	mutex_lock(&ig.device_list_mutex);
>>>  
>>> -	p_list = ig.device_list.next;
>>> -	while (p_list != &ig.device_list) {
>>> -		device = list_entry(p_list, struct iser_device, ig_list);
>>> -		/* find if there's a match using the node GUID */
>>> +	list_for_each_entry(device, &ig.device_list, ig_list)
>>>       
>> I've just added the original comments that are missing in your patch.
>>     
>
> Ah well, I probably should've mentioned in the patch description that I
> intentionally removed those comments as I think they're really
> redundant, stating the obvious. But of course I won't insist. :)
>
> Thanks,
> Arne
>   
OK and thanks for catching the bugs.

Roland - will you be able to merge these 2 patches for 2.6.25? Both are
bug fixes.

Thanks,
Erez

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