Commit 3522ea72 authored by Herbert Xu's avatar Herbert Xu Committed by Lee Jones
Browse files

UPSTREAM: crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg



commit 1b34cbbf upstream.

Issuing two writes to the same af_alg socket is bogus as the
data will be interleaved in an unpredictable fashion.  Furthermore,
concurrent writes may create inconsistencies in the internal
socket state.

Disallow this by adding a new ctx->write field that indiciates
exclusive ownership for writing.

Bug: 446278751
Fixes: 8ff59090 ("crypto: algif_skcipher - User-space interface for skcipher operations")
Reported-by: default avatarMuhammad Alifa Ramdhan <ramdhan@starlabs.sg>
Reported-by: default avatarBing-Jhong Billy Jheng <billy@starlabs.sg>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9aee87da)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: Ie4b99c532ab77a6e25483ece1f42ed4c4744e70f
parent a5b29469
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment