Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1320894

Re: [PATCH] crypto: af_alg - add async support to algif_aead

From Stephan Mueller <smueller@chronox.de>
Newsgroups linux.kernel
Subject Re: [PATCH] crypto: af_alg - add async support to algif_aead
Date 2016-01-28 18:20 +0100
Message-ID <qVYoG-6D9-31@gated-at.bofh.it> (permalink)
References <qVGBr-20k-1@gated-at.bofh.it> <qVOfE-7O2-17@gated-at.bofh.it> <qVXiW-5U4-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am Donnerstag, 28. Januar 2016, 08:00:25 schrieb Tadeusz Struk:

Hi Tadeusz,

>Hi Stephan,
>
>On 01/27/2016 10:26 PM, Stephan Mueller wrote:
>>> +	for (i = 0; i < areq->tsgls; i++)
>>> 
>>> > +		put_page(sg_page(sg + i));
>> 
>> Shouldn't here be the same logic as in put_sgl? I.e.
>> 
>>         for (i = 0; i < sgl->cur; i++) {
>>         
>>                 if (!sg_page(sg + i))
>>                 
>>                         continue;
>>                 
>>                 put_page(sg_page(sg + i));
>>                 sg_assign_page(sg + i, NULL);
>>         
>>         }
>
>Thanks for reviewing.
>I don't think it is possible that there ever will be any gaps in the tsgl.
>In fact if there is such a possibility then it is a serious problem, because
>it would mean that we are sending NULL ptrs to the ciphers (see line 640):
>
>	sg_mark_end(sgl->sg + sgl->cur - 1);
>	aead_request_set_crypt(&ctx->aead_req, sgl->sg, ctx-
>first_rsgl.sgl.sg,
>			       used, ctx->iv);
>
>I don't see any implementation checking for null in sgls. Most of them just
>do:
>
>	for_each_sg(sgl, sg, nents, i)
>		sg_virt(sg)...
>
>So it would Oops there. I think this check in put_sgl is redundant.
>Thanks,

algif_skcipher does a similar check in skcipher_pull_sgl:

...
                        if (!sg_page(sg + i))
                                continue;
...
                        if (put)
                                put_page(sg_page(sg + i));
                        sg_assign_page(sg + i, NULL);
...


Ciao
Stephan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] crypto: af_alg - add async support to algif_aead Tadeusz Struk <tadeusz.struk@intel.com> - 2016-01-27 23:20 +0100
  Re: [PATCH] crypto: af_alg - add async support to algif_aead Stephan Mueller <smueller@chronox.de> - 2016-01-28 07:30 +0100
    Re: [PATCH] crypto: af_alg - add async support to algif_aead Tadeusz Struk <tadeusz.struk@intel.com> - 2016-01-28 17:10 +0100
      Re: [PATCH] crypto: af_alg - add async support to algif_aead Stephan Mueller <smueller@chronox.de> - 2016-01-28 18:20 +0100
        Re: [PATCH] crypto: af_alg - add async support to algif_aead Tadeusz Struk <tadeusz.struk@intel.com> - 2016-01-28 18:40 +0100

csiph-web