s2n-tls icon indicating copy to clipboard operation
s2n-tls copied to clipboard

fix: close all /dev/urandom open fds

Open boquan-fang opened this issue 4 months ago • 0 comments

Resolved issues:

Partially solve https://github.com/aws/s2n-tls/issues/4005

Description of changes:

  • Clean up all of opened /dev/urandom.

Call-outs:

  • See PR#4833 and PR#4834 for fixes of other open fds.
  • I didn't add a test in this PR. The test to detect all opened fds will be in a separate PR.

Testing:

  • Test locally.
    • Add --track-fds=yes to CTest memcheck and direct all Valgrind output to MemoryTester.log files.
    • Search in VS Code for Open File Descriptors of /dev/urandom.
      • Previously opened /dev/urandom in tests that are fixed.
    • This is similar to the check in ./codebuild/bin/test_exec_leak.sh. https://github.com/aws/s2n-tls/blob/6bb195c23fd1ecf623dece3b43644e7c9a9e0e20/codebuild/bin/test_exec_leak.sh#L82-L97
  • Open fds test will be implemented once PR#4851 is merged.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

boquan-fang avatar Oct 09 '24 22:10 boquan-fang