Re: [PATCH v2] crypto: AF_ALG - race-free access of encryption flag

From: Stephan Müller
Date: Wed Nov 29 2017 - 06:05:22 EST


Am Mittwoch, 29. November 2017, 08:10:49 CET schrieb Herbert Xu:

Hi Herbert,

>
> It sort of worked for skcipher because it didn't care if ctx->enc
> or even ctx->iv changed midstream. But even there I don't think
> we need to wait a second time. In fact waiting a second time could
> result in a dead-lock if no sendmsg call came around.

Shouldn't we then create a patch for the pre-4.14 algif_skcipher code that
moves the wait out of the while loop to the beginning of the function in
recvmsg?

Ciao
Stephan