crypto: ccp/gcm - use const time tag comparison.
Subsystems (2)
PATCH 1/1 crypto: ccp/gcm - use const time tag comparison.
Avoid leaking GCM tag through timing side channel.
Signed-off-by Cfir Cohen <[email protected]>
--- drivers/crypto/ccp/ccp-ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/crypto/ccp/ccp-ops.c +2 -1
@@ -840,7 +840,8 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,if (ret) goto e_tag; - ret =memcmp (tag.address, final_wa.address,AES_BLOCK_SIZE ); + ret =crypto_memneq (tag.address, final_wa.address, +AES_BLOCK_SIZE ) ? -EBADMSG :0 ;ccp_dm_free (&tag); }
Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog
Quoted 24 lines · Cfir Cohen
Avoid leaking GCM tag through timing side channel.
Signed-off-by Cfir Cohen <[email protected]>--- drivers/crypto/ccp/ccp-ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/crypto/ccp/ccp-ops.c +2
-1@@ -840,7 +840,8 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,if (ret) goto e_tag; - ret =memcmp (tag.address, final_wa.address,AES_BLOCK_SIZE ); + ret =crypto_memneq (tag.address, final_wa.address, +AES_BLOCK_SIZE ) ? -EBADMSG :0 ;ccp_dm_free (&tag); }Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog
Looks like this needs:
Fixes: 36cf515b9bbe ("crypto: ccp - Enable support for AES GCM on v5 CCPs")
Cc: <[email protected]> # v4.12+- Eric
Quoted 22 lines · Eric Biggers
Quoted 21 lines · Cfir Cohen
Avoid leaking GCM tag through timing side channel.
Signed-off-by Cfir Cohen <[email protected]>--- drivers/crypto/ccp/ccp-ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/crypto/ccp/ccp-ops.c +2
-1@@ -840,7 +840,8 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,if (ret) goto e_tag; - ret =memcmp (tag.address, final_wa.address,AES_BLOCK_SIZE ); + ret =crypto_memneq (tag.address, final_wa.address, +AES_BLOCK_SIZE ) ? -EBADMSG :0 ;ccp_dm_free (&tag); }
Quoted 8 lines
Quoted 3 lines
Signature · 1 line
2.22.0.410.gd8fdbe21b5-googLooks like this needs:
Fixes: 36cf515b9bbe ("crypto: ccp - Enable support for AES GCM on v5 CCPs") Cc: <[email protected]> # v4.12+
Yes, it does. For clarity, does that mean you've taken care of this?
Quoted 29 lines · Gary R Hook
Quoted 28 lines · Eric Biggers
Quoted 24 lines · Cfir Cohen
Avoid leaking GCM tag through timing side channel.
Signed-off-by Cfir Cohen <[email protected]>--- drivers/crypto/ccp/ccp-ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/crypto/ccp/ccp-ops.c +2
-1@@ -840,7 +840,8 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,if (ret) goto e_tag; - ret =memcmp (tag.address, final_wa.address,AES_BLOCK_SIZE ); + ret =crypto_memneq (tag.address, final_wa.address, +AES_BLOCK_SIZE ) ? -EBADMSG :0 ;ccp_dm_free (&tag); }Signature · 1 line
2.22.0.410.gd8fdbe21b5-googLooks like this needs:
Quoted 6 lines
Quoted 2 lines
Fixes: 36cf515b9bbe ("crypto: ccp - Enable support for AES GCM on v5 CCPs") Cc: <[email protected]> # v4.12+Yes, it does. For clarity, does that mean you've taken care of this?
Herbert is the person who will apply this, so he'd need to do it. But it might be better just to resend.
- Eric