Re: [1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-29 Thread Herbert Xu
On Wed, Nov 29, 2017 at 08:57:33AM +, Horia Geantă wrote: > > Considering this fixes the crash reported by Tudor: > https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg29172.html > I think it should be merged in this release cycle (v4.15). This only affects tcrypt right? Since tcrypt

Re: [1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-29 Thread Horia Geantă
On 11/29/2017 8:28 AM, Herbert Xu wrote: > On Tue, Oct 10, 2017 at 01:21:59PM +0300, Robert Baronescu wrote: >> In case buffer length is a multiple of PAGE_SIZE, >> the S/G table is incorrectly generated. >> Fix this by handling buflen = k * PAGE_SIZE separately. >> >> Signed-off-by: Robert Barones

Re: [1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-28 Thread Herbert Xu
On Tue, Oct 10, 2017 at 01:21:59PM +0300, Robert Baronescu wrote: > In case buffer length is a multiple of PAGE_SIZE, > the S/G table is incorrectly generated. > Fix this by handling buflen = k * PAGE_SIZE separately. > > Signed-off-by: Robert Baronescu Patch applied. Thanks. -- Email: Herbert

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-14 Thread Herbert Xu
On Sun, Nov 12, 2017 at 04:26:39PM +, Horia Geantă wrote: > > SG table always has 1 entry more than what's needed strictly for input data. > > Let's say buflen = npo * PAGE_SIZE. > SG table generated by the code will have npo + 1 entries: > -sg[0] - (1 entry) reserved for associated data, fill

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-14 Thread Horia Geantă
On 11/13/2017 8:28 PM, Tudor Ambarus wrote: > Hi, > > On 11/12/2017 06:26 PM, Horia Geantă wrote: > >> -sg[0] - (1 entry) reserved for associated data, filled outside >> sg_init_aead() > > Let's fill the sg[0] with aad inside sg_init_aead()! > This could be done, however I would not mix fixes w

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-14 Thread Horia Geantă
On 11/13/2017 8:24 PM, Tudor Ambarus wrote: > Hi, > > On 10/10/2017 01:21 PM, Robert Baronescu wrote: >> In case buffer length is a multiple of PAGE_SIZE, >> the S/G table is incorrectly generated. >> Fix this by handling buflen = k * PAGE_SIZE separately. >> >> Signed-off-by: Robert Baronescu >>

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-13 Thread Tudor Ambarus
Hi, On 11/12/2017 06:26 PM, Horia Geantă wrote: -sg[0] - (1 entry) reserved for associated data, filled outside sg_init_aead() Let's fill the sg[0] with aad inside sg_init_aead()! Cheers, ta

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-13 Thread Tudor Ambarus
Hi, On 10/10/2017 01:21 PM, Robert Baronescu wrote: In case buffer length is a multiple of PAGE_SIZE, the S/G table is incorrectly generated. Fix this by handling buflen = k * PAGE_SIZE separately. Signed-off-by: Robert Baronescu --- crypto/tcrypt.c | 6 -- 1 file changed, 4 insertions(

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-12 Thread Horia Geantă
On 11/10/2017 1:23 PM, Herbert Xu wrote: > On Fri, Nov 10, 2017 at 09:17:33AM +, Horia Geantă wrote: >> >>> I must be missing something. In the case rem == 0, let's say >>> the original value of np is npo. Then at the start of the loop, >>> np = npo - 1, and at the last iteration, k = npo - 2

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-10 Thread Herbert Xu
On Fri, Nov 10, 2017 at 09:17:33AM +, Horia Geantă wrote: > > > I must be missing something. In the case rem == 0, let's say > > the original value of np is npo. Then at the start of the loop, > > np = npo - 1, and at the last iteration, k = npo - 2, so we do > IIUC at the start of the loop n

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-10 Thread Horia Geantă
On 11/10/2017 9:43 AM, Herbert Xu wrote: > On Fri, Nov 10, 2017 at 06:37:22AM +, Horia Geantă wrote: >> On 11/10/2017 12:21 AM, Herbert Xu wrote: >>> On Thu, Nov 09, 2017 at 02:37:29PM +, Horia Geantă wrote: >> sg_init_table(sg, np + 1); sg_mark_end() marks sg[np]. >>

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Herbert Xu
On Fri, Nov 10, 2017 at 06:37:22AM +, Horia Geantă wrote: > On 11/10/2017 12:21 AM, Herbert Xu wrote: > > On Thu, Nov 09, 2017 at 02:37:29PM +, Horia Geantă wrote: > >> > sg_init_table(sg, np + 1); > >> sg_mark_end() marks sg[np]. > >> > -np--; > +if

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Horia Geantă
On 11/10/2017 12:21 AM, Herbert Xu wrote: > On Thu, Nov 09, 2017 at 02:37:29PM +, Horia Geantă wrote: >> sg_init_table(sg, np + 1); >> sg_mark_end() marks sg[np]. >> - np--; + if (rem) + np--; for (k = 0; k < np; k++) sg_set_buf(&sg[k +

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Herbert Xu
On Thu, Nov 09, 2017 at 02:37:29PM +, Horia Geantă wrote: > > >>sg_init_table(sg, np + 1); > sg_mark_end() marks sg[np]. > > >> - np--; > >> + if (rem) > >> + np--; > >>for (k = 0; k < np; k++) > >>sg_set_buf(&sg[k + 1], xbuf[k], PAGE_SIZE); > In case rem == 0, l

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Horia Geantă
On 11/3/2017 2:42 PM, Herbert Xu wrote: > On Tue, Oct 10, 2017 at 01:21:59PM +0300, Robert Baronescu wrote: >> In case buffer length is a multiple of PAGE_SIZE, >> the S/G table is incorrectly generated. >> Fix this by handling buflen = k * PAGE_SIZE separately. >> >> Signed-off-by: Robert Baronesc

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-03 Thread Herbert Xu
On Tue, Oct 10, 2017 at 01:21:59PM +0300, Robert Baronescu wrote: > In case buffer length is a multiple of PAGE_SIZE, > the S/G table is incorrectly generated. > Fix this by handling buflen = k * PAGE_SIZE separately. > > Signed-off-by: Robert Baronescu > --- > crypto/tcrypt.c | 6 -- > 1 fi

[PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-10-10 Thread Robert Baronescu
In case buffer length is a multiple of PAGE_SIZE, the S/G table is incorrectly generated. Fix this by handling buflen = k * PAGE_SIZE separately. Signed-off-by: Robert Baronescu --- crypto/tcrypt.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/tcrypt.c b/crypto