[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231013095523.184497-1-ingyujang25@unist.ac.kr>
Date: Fri, 13 Oct 2023 18:55:23 +0900
From: Ingyu Jang <ingyujang25@...st.ac.kr>
To: davem@...emloft.net
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
ysjeon@...st.ac.kr, Ingyu Jang <ingyujang25@...st.ac.kr>
Subject: [PATCH] crypto: authencesn - Fix incorrect setauthsize function
Fixes a mismatch between 'setauthsize' documentation and
actual behavior of 'crypto_authenc_esn_setauthsize()' function
As per the documentation in 'aead.h' for the '@...authsize' attribute:
@setauthsize: Set authentication size for the AEAD transformation. This
function is used to specify the consumer requested size of the
authentication tag to be either generated by the transformation
during encryption or the size of the authentication tag to be
supplied during the decryption operation. This function is also
responsible for checking the authentication tag size for
validity.
However, the implementation does not align with this description.
The function only checked the validity of the input authsize without setting it.
Consequently, 'authsize' is used without being initialized,
resulting in an uninitialized memory read issue.
Signed-off-by: Ingyu Jang <ingyujang25@...st.ac.kr>
---
crypto/authencesn.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/crypto/authencesn.c b/crypto/authencesn.c
index 91424e791d5c..c1346d5b7950 100644
--- a/crypto/authencesn.c
+++ b/crypto/authencesn.c
@@ -52,6 +52,8 @@ static int crypto_authenc_esn_setauthsize(struct crypto_aead *authenc_esn,
if (authsize > 0 && authsize < 4)
return -EINVAL;
+ authenc_esn->authsize = authsize;
+
return 0;
}
--
2.34.1
Powered by blists - more mailing lists