From: Tadeusz Struk <tadeusz.struk-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Stephan Mueller <smueller-T9tCv8IpfcWELgA04lAiVw@public.gmane.org>
Cc: 'Herbert Xu
<herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>,
'Quentin Gouchet'
<quentin.gouchet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Daniel Borkmann
<dborkman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v13 1/2] crypto: AF_ALG: add AEAD support
Date: Thu, 11 Jun 2015 15:59:29 -0700 [thread overview]
Message-ID: <557A12D1.90409@intel.com> (raw)
In-Reply-To: <14853152.iudhcNpbrH-PJstQz4BMNNP20K/wil9xYQuADTiUCJX@public.gmane.org>
Hi Stephan,
On 02/28/2015 11:50 AM, Stephan Mueller wrote:
> + err = af_alg_wait_for_completion(ctx->enc ?
> + crypto_aead_encrypt(&ctx->aead_req) :
> + crypto_aead_decrypt(&ctx->aead_req),
> + &ctx->completion);
> +
> + if (err) {
> + /* EBADMSG implies a valid cipher operation took place */
> + if (err == -EBADMSG)
> + aead_put_sgl(sk);
> + goto unlock;
Shouldn't we free the TX sgl regardless of the error was?
Or do we expect that the user will try to read again and it will be Ok the second time?
Hope you still remember :)
> + }
> +
> + aead_put_sgl(sk);
> +
> + err = 0;
> +
> +unlock:
> + for (i = 0; i < cnt; i++)
> + af_alg_free_sg(&ctx->rsgl[i]);
> +
> + aead_wmem_wakeup(sk);
> + release_sock(sk);
> +
> + return err ? err : outlen;
> +}
next prev parent reply other threads:[~2015-06-11 22:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-28 19:49 [PATCH v13 0/2] crypto: AF_ALG: add AEAD support Stephan Mueller
2015-02-28 19:50 ` [PATCH v13 1/2] " Stephan Mueller
[not found] ` <14853152.iudhcNpbrH-PJstQz4BMNNP20K/wil9xYQuADTiUCJX@public.gmane.org>
2015-06-11 22:59 ` Tadeusz Struk [this message]
[not found] ` <557A12D1.90409-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-06-11 23:03 ` Stephan Mueller
2015-02-28 19:50 ` [PATCH v13 2/2] crypto: AF_ALG: enable AEAD interface compilation Stephan Mueller
2015-03-04 9:16 ` [PATCH v13 0/2] crypto: AF_ALG: add AEAD support Herbert Xu
2015-03-04 9:25 ` Stephan Mueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=557A12D1.90409@intel.com \
--to=tadeusz.struk-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dborkman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=quentin.gouchet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=smueller-T9tCv8IpfcWELgA04lAiVw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).