lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YeQs7Fy5NaK6m6Ar@iki.fi>
Date:   Sun, 16 Jan 2022 16:34:20 +0200
From:   Jarkko Sakkinen <jarkko@...nel.org>
To:     Tadeusz Struk <tstruk@...il.com>
Cc:     Shuah Khan <shuah@...nel.org>, linux-integrity@...r.kernel.org,
        linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] selftests: tpm: add async space test with
 noneexisting handle

On Sat, Jan 15, 2022 at 05:26:27PM -0800, Tadeusz Struk wrote:
> Add a test for /dev/tpmrm0 in async mode that checks if
> the code handles invalid handles correctly.
> 
> Cc: Jarkko Sakkinen <jarkko@...nel.org>
> Cc: Shuah Khan <shuah@...nel.org>
> Cc: <linux-integrity@...r.kernel.org>
> Cc: <linux-kselftest@...r.kernel.org>
> Cc: <linux-kernel@...r.kernel.org>
> 
> Tested-by: Jarkko Sakkinen<jarkko@...nel.org>
> Signed-off-by: Tadeusz Struk <tstruk@...il.com>
> ---
> Changed in v2:
> - Updated commit message
> Changed in v3:
> - Fixed typo in the function name
> ---
>  tools/testing/selftests/tpm2/tpm2_tests.py | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/tools/testing/selftests/tpm2/tpm2_tests.py b/tools/testing/selftests/tpm2/tpm2_tests.py
> index 9d764306887b..340ffef97fb6 100644
> --- a/tools/testing/selftests/tpm2/tpm2_tests.py
> +++ b/tools/testing/selftests/tpm2/tpm2_tests.py
> @@ -302,3 +302,19 @@ class AsyncTest(unittest.TestCase):
>          log.debug("Calling get_cap in a NON_BLOCKING mode")
>          async_client.get_cap(tpm2.TPM2_CAP_HANDLES, tpm2.HR_LOADED_SESSION)
>          async_client.close()
> +
> +    def test_flush_invalid_context(self):
> +        log = logging.getLogger(__name__)
> +        log.debug(sys._getframe().f_code.co_name)
> +
> +        async_client = tpm2.Client(tpm2.Client.FLAG_SPACE | tpm2.Client.FLAG_NONBLOCK)
> +        log.debug("Calling flush_context passing in an invalid handle ")
> +        handle = 0x80123456
> +        rc = 0
> +        try:
> +            async_client.flush_context(handle)
> +        except OSError as e:
> +            rc = e.errno
> +
> +        self.assertEqual(rc, 22)
> +        async_client.close()
> -- 
> 2.30.2
> 

Thank you.

Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ