]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
crypto: ecc - Fix NULL pointer deref. on no default_rng
authorPierre <pinaraf@pinaraf.info>
Sun, 12 Nov 2017 14:24:32 +0000 (15:24 +0100)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 19 Mar 2018 23:41:11 +0000 (20:41 -0300)
commit2341559f4d5ec3b5d009313e8a865759199eada2
treeab2b41cb45699d64362bd00938c1b6f3bd91fa9d
parent5faf92e02642b53d5dc70ae668a70ad3d40ae15f
crypto: ecc - Fix NULL pointer deref. on no default_rng

BugLink: http://bugs.launchpad.net/bugs/1756978
[ Upstream commit 4c0e22c90510308433272d7ba281b1eb4eda8209 ]

If crypto_get_default_rng returns an error, the
function ecc_gen_privkey should return an error.
Instead, it currently tries to use the default_rng
nevertheless, thus creating a kernel panic with a
NULL pointer dereference.
Returning the error directly, as was supposedly
intended when looking at the code, fixes this.

Signed-off-by: Pierre Ducroquet <pinaraf@pinaraf.info>
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
crypto/ecc.c