crypto: tegra - fix rctx->cryptlen calculation in tegra_gcm_do_one_req()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
crypto: tegra - fix rctx->cryptlen calculation in tegra_gcm_do_one_req()
Perform rctx->cryptlen calculation in tegra_gcm_do_one_req() the same way it is done in tegra_ccm_crypt_init(). The current formulae may lead to a crash if a caller does not call tegra_gcm_setauthsize() and so ctx->authsize remains zero. Then a decrypt operation with incorrect rctx->cryptlen will lead to a write beyound rctx->dst_sg buffer.
As a follow-up cleanup delete struct tegra_aead_ctx->authsize field since it appears to be completely unused. Also simplify tegra_ccm_setauthsize() and tegra_gcm_setauthsize() functions respectively.
From the CVE record · Linux
The Tegra GCM code in the Linux kernel can calculate the wrong cryptlen if a caller does not call tegra_gcm_setauthsize(), leaving authsize at zero. A subsequent decrypt operation can write beyond the destination buffer and cause a crash; the input does not establish whether an attacker can trigger this or what access would be required.
Engineers running Linux kernels with Tegra GCM crypto should check their deployments; affected versions are not specified.