aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-04-17 17:00:56 +0200
committerBruce Ashfield <bruce.ashfield@windriver.com>2016-08-30 12:11:57 -0400
commit9af2bb70f3c1a1ddc1bfd822f33cf720449f1946 (patch)
treebb3b6645f7781a7a209de156acdfe939625f333f
parent53ab771376c4460838dc7998bc95a7824ea12b72 (diff)
downloadlinux-yocto-9af2bb70f3c1a1ddc1bfd822f33cf720449f1946.tar.gz
linux-yocto-9af2bb70f3c1a1ddc1bfd822f33cf720449f1946.tar.bz2
linux-yocto-9af2bb70f3c1a1ddc1bfd822f33cf720449f1946.zip
cryptodev: When
That is because in AEAD modes we need to write more data than we read (the tag value). Reported and investigated by Dian Nguyen. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--drivers/staging/crypto/cryptodev/zc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/crypto/cryptodev/zc.c b/drivers/staging/crypto/cryptodev/zc.c
index 809a36d7ce98..29b05018f868 100644
--- a/drivers/staging/crypto/cryptodev/zc.c
+++ b/drivers/staging/crypto/cryptodev/zc.c
@@ -162,6 +162,10 @@ int get_userbuf(struct csession *ses,
}
if (src == dst) { /* inplace operation */
+ /* When we encrypt for authenc modes we need to write
+ * more data than the ones we read. */
+ if (src_len < dst_len)
+ src_len = dst_len;
rc = __get_userbuf(src, src_len, 1, ses->used_pages,
ses->pages, ses->sg, task, mm);
if (unlikely(rc)) {