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: <YylCPAGbn7MgICau@kernel.org>
Date:   Tue, 20 Sep 2022 07:31:56 +0300
From:   Jarkko Sakkinen <jarkko@...nel.org>
To:     Stefan Berger <stefanb@...ux.vnet.ibm.com>
Cc:     linux-integrity@...r.kernel.org, peterhuewe@....de,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        skhan@...uxfoundation.org, Stefan Berger <stefanb@...ux.ibm.com>,
        Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH] selftests: tpm2: Implement class desstructor to close
 file descriptor

s/desstructor/destructor/

I'd change it to "selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle"

On Fri, Sep 09, 2022 at 11:20:56AM -0400, Stefan Berger wrote:
> From: Stefan Berger <stefanb@...ux.ibm.com>
> 
> Implement a class destructor to close the open TPM file descriptor
> and avoid the following error message:
> 
>  test_flush_context (tpm2_tests.SpaceTest) ... \
>    /usr/lib64/python3.6/unittest/case.py:605: ResourceWarning: \
>    unclosed file <_io.FileIO name='/dev/tpmrm0' mode='rb+' closefd=True>

I don't recall seeing this. Does this happen on every test case?

Should better describe what is going on, e.g.

"
The following output can bee seen when the test is executed:

  test_flush_context (tpm2_tests.SpaceTest) ... \
    /usr/lib64/python3.6/unittest/case.py:605: ResourceWarning: \
    unclosed file <_io.FileIO name='/dev/tpmrm0' mode='rb+' closefd=True>

An instance of Client does not implicitly close /dev/tpm* handle, once it
gets destroyed. Close the file handle in the class destructor
Client.__del__().
"

> 
> Fixes: 6ea3dfe1e0732 ("selftests: add TPM 2.0 tests")
> Cc: Shuah Khan <shuah@...nel.org>
> Cc: linux-kselftest@...r.kernel.org
> Cc: Jarkko Sakkinen <jarkko@...nel.org>
> Signed-off-by: Stefan Berger <stefanb@...ux.ibm.com>

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ