]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
crypto: shash - Fix zero-length shash ahash digest crash
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 9 Oct 2017 15:30:02 +0000 (23:30 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:49:29 +0000 (09:49 -0500)
commit9250d71b11906a2bda56fc79720ec6c938874092
tree6e844eeeaea065585a98c5fc5dd2c0efb9639c24
parentd6b01cff6d2cc3a907e0f95e3121867c745e5296
crypto: shash - Fix zero-length shash ahash digest crash

BugLink: http://bugs.launchpad.net/bugs/1724669
commit b61907bb42409adf9b3120f741af7c57dd7e3db2 upstream.

The shash ahash digest adaptor function may crash if given a
zero-length input together with a null SG list.  This is because
it tries to read the SG list before looking at the length.

This patch fixes it by checking the length first.

Reported-by: Stephan Müller<smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Stephan Müller <smueller@chronox.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
crypto/shash.c