From 2f28c6b677ff9407663e272bf86df96afbe7555b Mon Sep 17 00:00:00 2001 From: JoeSubbiani Date: Fri, 18 Jun 2021 11:03:57 +0100 Subject: [PATCH 1/6] Free context 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. Already resolved for 2.x and development - this is a backport for 2.16 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 23bf83d093..1b7e5dbb27 100644 --- a/tests/suites/test_suite_aes.function +++ b/tests/suites/test_suite_aes.function @@ -208,6 +208,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 402b1451c09a3220e551f6fafcd5abc4876e1c75 Mon Sep 17 00:00:00 2001 From: JoeSubbiani Date: Fri, 18 Jun 2021 11:41:14 +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 0000000000..35cc8470ef --- /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 cbe60337e3edb705e57baa4b07190f007d37214e Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 18 Jun 2021 15:23:34 +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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.d/issue4176.txt b/ChangeLog.d/issue4176.txt index 35cc8470ef..52181a1f76 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 + * Fix an issue where resource is never freed when running one particular + test suite with an alternative AES implementation. Fixes #4176 From dcdb277f34058b55c06dddbd2090e4af03286a40 Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Fri, 18 Jun 2021 17:54:26 +0100 Subject: [PATCH 4/6] Update changelog formatting - Missing Free Context Trailing white space causing check_files.py to fail issue4176.txt was also in dos format - this has been changed to unix 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 52181a1f76..e1ed5d6e19 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 +Bugfix + * Fix an issue where resource is never freed when running one particular + test suite with an alternative AES implementation. Fixes #4176 From c8031855d055863d357bd2853aaf604c80d7cbae Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Mon, 21 Jun 2021 09:30:50 +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 e1ed5d6e19..d362f1080e 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 b047f99441494a7b6fee515eff8d626f6793dc2f Mon Sep 17 00:00:00 2001 From: Joe Subbiani Date: Mon, 21 Jun 2021 16:59:25 +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 d362f1080e..ddca37f9be 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.