]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: algif_hash - Fix result clobbering in recvmsg
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 21 Nov 2016 07:34:00 +0000 (15:34 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 22 Nov 2016 07:02:24 +0000 (15:02 +0800)
commitcbf3135f17bc6b5af723a0ca0b71ac7811119a07
tree4d96cad9eef7f8f4eb502c3766cfa03f813460e3
parente04789c2e0bf2a712839c942019e8d28e1a4f439
crypto: algif_hash - Fix result clobbering in recvmsg

Recently an init call was added to hash_recvmsg so as to reset
the hash state in case a sendmsg call was never made.

Unfortunately this ended up clobbering the result if the previous
sendmsg was done with a MSG_MORE flag.  This patch fixes it by
excluding that case when we make the init call.

Fixes: e04789c2e0bf ("algif_hash - Fix NULL hash crash with shash")
Reported-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_hash.c