aboutsummaryrefslogtreecommitdiff
path: root/lib/crypto/mpi/mpi-cmp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-08-11crypto: lib/mpi - avoid null pointer deref in mpi_cmp_ui()Mark O'Donovan1-2/+6
During NVMeTCP Authentication a controller can trigger a kernel oops by specifying the 8192 bit Diffie Hellman group and passing a correctly sized, but zeroed Diffie Hellamn value. mpi_cmp_ui() was detecting this if the second parameter was 0, but 1 is passed from dh_is_pubkey_valid(). This causes the null pointer u->d to be dereferenced towards the end of mpi_cmp_ui() Signed-off-by: Mark O'Donovan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2023-08-11crypto: lib - Move mpi into lib/cryptoHerbert Xu1-0/+94
As lib/mpi is mostly used by crypto code, move it under lib/crypto so that patches touching it get directed to the right mailing list. Signed-off-by: Herbert Xu <[email protected]> Reviewed-by: Mimi Zohar <[email protected]> Signed-off-by: Herbert Xu <[email protected]>