Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-28 Thread Herbert Xu
On Sat, Nov 19, 2016 at 10:08:06PM +0100, Stephan Mueller wrote: > > The way to go on this topic would be to use the same logic as the authenc > implementation by using a null cipher for the copy operation. Though, finding > out whether the src and dst buffers are the same is an interesting > p

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-19 Thread Stephan Mueller
Am Mittwoch, 16. November 2016, 17:04:46 CET schrieb Herbert Xu: Hi Herbert, > On Wed, Nov 16, 2016 at 10:02:59AM +0100, Stephan Mueller wrote: > > One thing occurred to me: The copying of the AD would only be done of src > > != dst. For the AF_ALG interface, I thing we always have src != dst due

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-16 Thread Herbert Xu
On Wed, Nov 16, 2016 at 10:02:59AM +0100, Stephan Mueller wrote: > Am Mittwoch, 16. November 2016, 16:57:42 CET schrieb Herbert Xu: > > Hi Herbert, > > > On Tue, Nov 15, 2016 at 08:06:47PM +0100, Stephan Mueller wrote: > > > Shall the fix be rolled into the patch together with the fix for the tag

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-16 Thread Herbert Xu
On Wed, Nov 16, 2016 at 10:02:59AM +0100, Stephan Mueller wrote: > > One thing occurred to me: The copying of the AD would only be done of src != > dst. For the AF_ALG interface, I thing we always have src != dst due to the > user space/kernel space translation. That means the kernel copies the A

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-16 Thread Stephan Mueller
Am Mittwoch, 16. November 2016, 16:57:42 CET schrieb Herbert Xu: Hi Herbert, > On Tue, Nov 15, 2016 at 08:06:47PM +0100, Stephan Mueller wrote: > > Shall the fix be rolled into the patch together with the fix for the tag > > value as well as the crash fix? Or can we have a stand-alone patch fixin

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-16 Thread Herbert Xu
On Wed, Nov 16, 2016 at 04:57:42PM +0800, Herbert Xu wrote: > On Tue, Nov 15, 2016 at 08:06:47PM +0100, Stephan Mueller wrote: > > > > Shall the fix be rolled into the patch together with the fix for the tag > > value > > as well as the crash fix? Or can we have a stand-alone patch fixing this. >

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-16 Thread Herbert Xu
On Tue, Nov 15, 2016 at 08:06:47PM +0100, Stephan Mueller wrote: > > Shall the fix be rolled into the patch together with the fix for the tag > value > as well as the crash fix? Or can we have a stand-alone patch fixing this. I think these are two separate issues and we don't need to fix them al

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-15 Thread Stephan Mueller
Am Samstag, 12. November 2016, 10:13:02 CET schrieb Herbert Xu: Hi Herbert, > On Sat, Nov 12, 2016 at 03:03:36AM +0100, Stephan Mueller wrote: > > When you have separate buffers, the kernel does not seem to copy the AD > > over to the target buffer. > > OK we should definitely fix that. Shall t

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-11 Thread Herbert Xu
On Sat, Nov 12, 2016 at 03:03:36AM +0100, Stephan Mueller wrote: > > When you have separate buffers, the kernel does not seem to copy the AD over > to the target buffer. OK we should definitely fix that. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: htt

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-11 Thread Stephan Mueller
Am Samstag, 12. November 2016, 09:55:19 CET schrieb Herbert Xu: Hi Herbert, > On Thu, Nov 10, 2016 at 04:32:03AM +0100, Stephan Mueller wrote: > > The kernel crypto API AEAD cipher operation generates output such that > > space for the AAD is reserved in the output buffer without being > > touche

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-11 Thread Stephan Mueller
Am Freitag, 11. November 2016, 16:26:12 CET schrieb Mat Martineau: Hi Mat, > > > > With this solution, the caller must not use sendpage with the exact same > > buffers for input and output. The following rationale applies: When > > the caller sends the same buffer for input/output to the sendpage

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-11 Thread Herbert Xu
On Thu, Nov 10, 2016 at 04:32:03AM +0100, Stephan Mueller wrote: > The kernel crypto API AEAD cipher operation generates output such that > space for the AAD is reserved in the output buffer without being > touched. The processed ciphertext/plaintext is appended to the reserved > AAD buffer. > > T

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-11 Thread Mat Martineau
Stephan, On Thu, 10 Nov 2016, Stephan Mueller wrote: The kernel crypto API AEAD cipher operation generates output such that space for the AAD is reserved in the output buffer without being touched. The processed ciphertext/plaintext is appended to the reserved AAD buffer. The user space inter

[PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-09 Thread Stephan Mueller
The kernel crypto API AEAD cipher operation generates output such that space for the AAD is reserved in the output buffer without being touched. The processed ciphertext/plaintext is appended to the reserved AAD buffer. The user space interface followed that approach. However, this is a violation