[lkml]   [2017]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] Fix af_alg in 3.12
On Fri, Feb 03, 2017 at 01:05:48PM +0100, Torsten Duwe wrote:
> If Herbert does not have a better idea, I suggest to back out this change and fix
> dynamically allocated key structures for the individual algorithms instead, for
> the older branches.

So, the solution IMHO is to revert


that is the whole sequence from 82a0aa2c08de674191..b2a0707817d3dec836
backwards sans b9da7c51a11a2e7 which is a separate, unrelated fix.

This series aimed to fix the whole class of problems and creates and fixes
its own ABI breakage. But since that problem class contains exactly
1 element, fix instead the one broken algorithm with a dynamically
allocated member in its context that gets initialised during setkey.

Signed-off-by: Torsten Duwe <>
Cc: <> # v3.0+

diff --git a/crypto/lrw.c b/crypto/lrw.c
index 6f9908a..4c9257d 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -150,6 +150,9 @@ static int crypt(struct blkcipher_desc *d,
u8 *wsrc;
u8 *wdst;

+ if (!(ctx->table.table))
+ return -ENOKEY;
err = blkcipher_walk_virt(d, w);
if (!(avail = w->nbytes))
return err;
@@ -229,6 +232,9 @@ int lrw_crypt(struct blkcipher_desc *desc, struct scatterlist *sdst,

BUG_ON(max_blks < 1);

+ if (!ctx->table)
+ return -ENOKEY;
blkcipher_walk_init(&walk, sdst, ssrc, nbytes);

err = blkcipher_walk_virt(desc, &walk);
 \ /
  Last update: 2017-02-14 19:07    [W:0.051 / U:1.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site