OSDN Git Service

qcacld: check if auth_tag_len exceeds sizeof(hash)
authorPark Ju Hyung <qkrwngud825@gmail.com>
Sat, 6 Jul 2019 18:00:59 +0000 (03:00 +0900)
committer0ranko0P <ranko0p@outlook.com>
Tue, 24 Dec 2019 20:42:10 +0000 (04:42 +0800)
Without this check, memcmp() compile-time check fails

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_fils.c

index 4877816..bae79bb 100644 (file)
@@ -779,6 +779,11 @@ static QDF_STATUS lim_process_auth_wrapped_data(tpPESession pe_session,
                pe_err("invalid remaining len %d",
                        remaining_len);
        }
+
+       if (sizeof(hash) < auth_tag_len) {
+               pe_err("sizeof(hash) < auth_tag_len check failed");
+               return QDF_STATUS_E_FAILURE;
+       }
        if (qdf_mem_cmp(wrapped_data, hash, auth_tag_len)) {
                pe_err("integratity check failed for auth, crypto %d",
                        crypto);