From 67889a5e64e4a91164e283546bfefb086504615b Mon Sep 17 00:00:00 2001 From: JoeSubbiani Date: Thu, 17 Jun 2021 16:12:23 +0100 Subject: [PATCH 1/6] Free context in at the end of aes_crypt_xts_size() in file tests/suite/test_suite_aes.function, aes_crypt_xts_size() did not free the context upon the function exit. The function now frees the context on exit. Fixes #4176 Signed-off-by: JoeSubbiani --- tests/suites/test_suite_aes.function | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/suites/test_suite_aes.function b/tests/suites/test_suite_aes.function index 754a16702..a90277d97 100644 --- a/tests/suites/test_suite_aes.function +++ b/tests/suites/test_suite_aes.function @@ -210,6 +210,8 @@ void aes_crypt_xts_size( int size, int retval ) /* Valid pointers are passed for builds with MBEDTLS_CHECK_PARAMS, as * otherwise we wouldn't get to the size check we're interested in. */ TEST_ASSERT( mbedtls_aes_crypt_xts( &ctx, MBEDTLS_AES_ENCRYPT, length, data_unit, src, output ) == retval ); +exit: + mbedtls_aes_xts_free( &ctx ); } /* END_CASE */ From 2af8d040853e83e4460137e341ae4f8c97765594 Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 18 Jun 2021 11:58:06 +0100 Subject: [PATCH 2/6] Changelog entry for Free Context in test_suite_aes fix Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ChangeLog.d/issue4176.txt diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt new file mode 100644 index 000000000..35cc8470e --- /dev/null +++ b/ChangeLog.d/issue4176.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix an issue where resource is never freed when running one particular test suite with an alternative AES implementation +Fixes #4176 \ No newline at end of file From 5e1fac8b2829de8aca005b96a2a32b20c834153e Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 18 Jun 2021 15:42:42 +0100 Subject: [PATCH 3/6] Update changelog formatting - Missing Free Context The original formatting was in dos and the changelog assembler would fail. The length of the description was too long horizontally. This has been updated. Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index 35cc8470e..8ca386f41 100644 --- a/ChangeLog.d/issue4176.txt +++ b/ChangeLog.d/issue4176.txt @@ -1,3 +1,3 @@ -Bugfix - * Fix an issue where resource is never freed when running one particular test suite with an alternative AES implementation -Fixes #4176 \ No newline at end of file +Bugfix + * Fix an issue where resource is never freed when running one particular + test suite with an alternative AES implementation. Fixes #4176 From 707186d1792add61010a3ddc9acd27286ea614ca Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 18 Jun 2021 17:45:34 +0100 Subject: [PATCH 4/6] Update changelog formatting Missing Free Context Trailing white space causing check_files.py to fail Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index 8ca386f41..e1ed5d6e1 100644 --- a/ChangeLog.d/issue4176.txt +++ b/ChangeLog.d/issue4176.txt @@ -1,3 +1,3 @@ Bugfix - * Fix an issue where resource is never freed when running one particular + * Fix an issue where resource is never freed when running one particular test suite with an alternative AES implementation. Fixes #4176 From 02945bcab43337963e6da1602d0486dbd5e28031 Mon Sep 17 00:00:00 2001 From: Joe Subbiani <85489920+JoeSubbiani@users.noreply.github.com> Date: Fri, 18 Jun 2021 18:52:41 +0100 Subject: [PATCH 5/6] Update changelog formatting - Missing Free Context Missing trailing full stop added to the end of the fixed issue number Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index e1ed5d6e1..d362f1080 100644 --- a/ChangeLog.d/issue4176.txt +++ b/ChangeLog.d/issue4176.txt @@ -1,3 +1,3 @@ Bugfix * Fix an issue where resource is never freed when running one particular - test suite with an alternative AES implementation. Fixes #4176 + test suite with an alternative AES implementation. Fixes #4176. From 7d5fa2be81b308d18b02b5cfe1c11f63b5ee59d4 Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Mon, 21 Jun 2021 16:57:28 +0100 Subject: [PATCH 6/6] Reword changelog - Test Resource Leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - “Fix an issue where X happens” → ”Fix X“ the extra words are just a distraction. - “resource” → “a resource” - “where resource is never freed” has a name: it's a resource leak - “when running one particular test suite” → “in a test suite” Signed-off-by: Joe Subbiani --- ChangeLog.d/issue4176.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index d362f1080..ddca37f9b 100644 --- a/ChangeLog.d/issue4176.txt +++ b/ChangeLog.d/issue4176.txt @@ -1,3 +1,3 @@ Bugfix - * Fix an issue where resource is never freed when running one particular - test suite with an alternative AES implementation. Fixes #4176. + * Fix a resource leak in a test suite with an alternative AES + implementation. Fixes #4176.