]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Tue, 22 Aug 2017 15:43:02 +0000 (08:43 -0700)
commited0fcd2ffdf066034064ded6c7ec7e82436ee78d
tree8642fd771d45f674df61cb7531b5527d1d60c886
parent51f608d5ae324c57588aab0d8fd8a9e97b50b583
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: a8348bca2944 ("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>
(cherry picked from commit 8acf7a106326eb94e143552de81f34308149121c)

Orabug: 25698521

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
crypto/algif_hash.c