1 From 5a6cd042d3cee9e3bbf3b0125a89e64d75dffdc7 Mon Sep 17 00:00:00 2001
2 From: Cristian Stoica <cristian.stoica@freescale.com>
3 Date: Thu, 31 Oct 2013 13:13:51 +0200
4 Subject: [[Patch][fsl 04/16] fix scatterlist size for in-place operations
6 Upstream-status: Pending
8 For in-place operations, the scatterlist must be big enough to allow for
9 either the source or destination data:
10 - for block ciphers, the destination will be bigger than the source if
11 the source is not multiple of blocksize
12 - for aead ciphers, the additional data and padding guarantees the
13 destination to be bigger than the source.
15 Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
16 Tested-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com>
19 1 file changed, 3 insertions(+), 2 deletions(-)
21 diff --git a/zc.c b/zc.c
22 index 809a36d..8855083 100644
25 @@ -162,8 +162,9 @@ int get_userbuf(struct csession *ses,
28 if (src == dst) { /* inplace operation */
29 - rc = __get_userbuf(src, src_len, 1, ses->used_pages,
30 - ses->pages, ses->sg, task, mm);
31 + rc = __get_userbuf(src, max(src_len, dst_len), 1, ses->used_pages,
32 + ses->pages, ses->sg, task, mm);
35 derr(1, "failed to get user pages for data IO");