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: <e1e4788d-9250-d4c3-937f-262bd9264a76@grimberg.me>
Date:   Mon, 21 Nov 2016 09:36:22 +0200
From:   Sagi Grimberg <sagi@...mberg.me>
To:     Binoy Jayan <binoy.jayan@...aro.org>,
        Doug Ledford <dledford@...hat.com>,
        Sean Hefty <sean.hefty@...el.com>,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        Leon Romanovsky <leonro@...lanox.com>,
        Sagi Grimberg <sagig@...lanox.com>,
        Bart Van Assche <bart.vanassche@...disk.com>,
        Nicholas Bellinger <nab@...ux-iscsi.org>,
        Jenny Derzhavetz <jennyf@...lanox.com>,
        Ira Weiny <ira.weiny@...el.com>,
        Steve Wise <swise@...ngridcomputing.com>,
        Mark Bloch <markb@...lanox.com>,
        Tatyana E Nikolova <tatyana.e.nikolova@...el.com>,
        Matan Barak <matanb@...lanox.com>,
        Lijun Ou <oulijun@...wei.com>,
        "Wei Hu(Xavier)" <xavier.huwei@...wei.com>
Cc:     Faisal Latif <faisal.latif@...el.com>,
        Mustafa Ismail <mustafa.ismail@...el.com>,
        Mark Brown <broonie@...nel.org>, Arnd Bergmann <arnd@...db.de>,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
        target-devel@...r.kernel.org
Subject: Re: [PATCH v5 5/9] IB/isert: Replace semaphore sem with completion


> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
> index 6dd43f6..de80f56 100644
> --- a/drivers/infiniband/ulp/isert/ib_isert.c
> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
> @@ -619,7 +619,7 @@
>  	mutex_unlock(&isert_np->mutex);
>
>  	isert_info("np %p: Allow accept_np to continue\n", isert_np);
> -	up(&isert_np->sem);
> +	complete(&isert_np->comp);
>  }
>
>  static void
> @@ -2311,7 +2311,7 @@ struct rdma_cm_id *
>  		isert_err("Unable to allocate struct isert_np\n");
>  		return -ENOMEM;
>  	}
> -	sema_init(&isert_np->sem, 0);
> +	init_completion(&isert_np->comp);

This is still racy, a connect event can complete just before we
init the completion and *will* get lost...

This code started off with a waitqueue which exposes the same
problem, see:
531b7bf4bd79 Target/iser: Fix iscsit_accept_np and rdma_cm racy flow

So, still NAK from me...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ