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: <28b9a7d4-d329-bb1e-d4eb-6530795eaa0b@amd.com>
Date:   Mon, 14 Aug 2017 11:55:44 -0500
From:   Gary R Hook <gary.hook@....com>
To:     Gilad Ben-Yossef <gilad@...yossef.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Jonathan Corbet <corbet@....net>,
        David Howells <dhowells@...hat.com>,
        "Lendacky, Thomas" <Thomas.Lendacky@....com>,
        Boris Brezillon <boris.brezillon@...e-electrons.com>,
        Arnaud Ebalard <arno@...isbad.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...hat.com>,
        "dm-devel@...hat.com" <dm-devel@...hat.com>,
        Shaohua Li <shli@...nel.org>, Steve French <sfrench@...ba.org>,
        "Theodore Y. Ts'o" <tytso@....edu>,
        Jaegeuk Kim <jaegeuk@...nel.org>,
        Mimi Zohar <zohar@...ux.vnet.ibm.com>,
        Dmitry Kasatkin <dmitry.kasatkin@...il.com>,
        James Morris <james.l.morris@...cle.com>,
        "Serge E. Hallyn" <serge@...lyn.com>,
        "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "keyrings@...r.kernel.org" <keyrings@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "linux-raid@...r.kernel.org" <linux-raid@...r.kernel.org>,
        "linux-cifs@...r.kernel.org" <linux-cifs@...r.kernel.org>,
        "samba-technical@...ts.samba.org" <samba-technical@...ts.samba.org>,
        "linux-fscrypt@...r.kernel.org" <linux-fscrypt@...r.kernel.org>,
        "linux-ima-devel@...ts.sourceforge.net" 
        <linux-ima-devel@...ts.sourceforge.net>,
        "linux-ima-user@...ts.sourceforge.net" 
        <linux-ima-user@...ts.sourceforge.net>,
        "linux-security-module@...r.kernel.org" 
        <linux-security-module@...r.kernel.org>
Cc:     Ofir Drang <ofir.drang@....com>
Subject: Re: [PATCH v5 02/19] crypto: ccp: use -EAGAIN for transient busy
 indication

On 08/14/2017 10:21 AM, Gilad Ben-Yossef wrote:
> Replace -EBUSY with -EAGAIN when reporting transient busy
> indication in the absence of backlog.
>
> Signed-off-by: Gilad Ben-Yossef <gilad@...yossef.com>

Reviewed-by: Gary R Hook <gary.hook@....com>

> ---
>  drivers/crypto/ccp/ccp-crypto-main.c | 8 +++-----
>  drivers/crypto/ccp/ccp-dev.c         | 7 +++++--
>  2 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/crypto/ccp/ccp-crypto-main.c b/drivers/crypto/ccp/ccp-crypto-main.c
> index 35a9de7..403ff0a 100644
> --- a/drivers/crypto/ccp/ccp-crypto-main.c
> +++ b/drivers/crypto/ccp/ccp-crypto-main.c
> @@ -222,9 +222,10 @@ static int ccp_crypto_enqueue_cmd(struct ccp_crypto_cmd *crypto_cmd)
>
>  	/* Check if the cmd can/should be queued */
>  	if (req_queue.cmd_count >= CCP_CRYPTO_MAX_QLEN) {
> -		ret = -EBUSY;
> -		if (!(crypto_cmd->cmd->flags & CCP_CMD_MAY_BACKLOG))
> +		if (!(crypto_cmd->cmd->flags & CCP_CMD_MAY_BACKLOG)) {
> +			ret = -EAGAIN;
>  			goto e_lock;
> +		}
>  	}
>
>  	/* Look for an entry with the same tfm.  If there is a cmd
> @@ -243,9 +244,6 @@ static int ccp_crypto_enqueue_cmd(struct ccp_crypto_cmd *crypto_cmd)
>  		ret = ccp_enqueue_cmd(crypto_cmd->cmd);
>  		if (!ccp_crypto_success(ret))
>  			goto e_lock;	/* Error, don't queue it */
> -		if ((ret == -EBUSY) &&
> -		    !(crypto_cmd->cmd->flags & CCP_CMD_MAY_BACKLOG))
> -			goto e_lock;	/* Not backlogging, don't queue it */
>  	}
>
>  	if (req_queue.cmd_count >= CCP_CRYPTO_MAX_QLEN) {
> diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c
> index 4e029b1..3d637e3 100644
> --- a/drivers/crypto/ccp/ccp-dev.c
> +++ b/drivers/crypto/ccp/ccp-dev.c
> @@ -292,9 +292,12 @@ int ccp_enqueue_cmd(struct ccp_cmd *cmd)
>  	i = ccp->cmd_q_count;
>
>  	if (ccp->cmd_count >= MAX_CMD_QLEN) {
> -		ret = -EBUSY;
> -		if (cmd->flags & CCP_CMD_MAY_BACKLOG)
> +		if (cmd->flags & CCP_CMD_MAY_BACKLOG) {
> +			ret = -EBUSY;
>  			list_add_tail(&cmd->entry, &ccp->backlog);
> +		} else {
> +			ret = -EAGAIN;
> +		}
>  	} else {
>  		ret = -EINPROGRESS;
>  		ccp->cmd_count++;
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ