Sfoglia il codice sorgente

Bluetooth: ecdh_helper - fix leak of private key

tmp buffer contains the swapped private key. In case the setkey call
failed, the tmp buffer was freed without clearing the private key.

Zeroize the temporary buffer so we don't leak the private key.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Tudor Ambarus 7 anni fa
parent
commit
168ed65483
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      net/bluetooth/ecdh_helper.c

+ 1 - 1
net/bluetooth/ecdh_helper.c

@@ -122,7 +122,7 @@ free_all:
 free_req:
 	kpp_request_free(req);
 free_tmp:
-	kfree(tmp);
+	kzfree(tmp);
 	return err;
 }