Skip to content

Conversation

jan-cerny
Copy link
Member

The function crapi_init calls gcry_check_version which must be
called before any other function from the Libgcrypt library. That might
be violated when multiple threads executing multiple probes are running.
The mitigation proposed in this PR is to call crapi_init only once
when the session is initialized which means before any threads are
spawned.

See also: https://www.gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html#Multi_002dThreading

Resolves: RHBZ#1959570

@lgtm-com
Copy link

lgtm-com bot commented Jul 8, 2021

This pull request introduces 1 alert when merging 9e15848 into f52f306 - view on LGTM.com

new alerts:

  • 1 for Implicit function declaration

@jan-cerny
Copy link
Member Author

so this time tests/API/XCCDF/unittests/test_remediate_simple.sh passed therefore which means that it fails unreliably

The function `crapi_init` calls `gcry_check_version` which must be
called before any other function from the Libgcrypt library. That might
be violated when multiple threads executing multiple probes are running.
The mitigation proposed in this PR is to call `crapi_init` only once
when the session is initialized which means before any threads are
spawned.

See also: https://www.gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html#Multi_002dThreading

Resolves: RHBZ#1959570
@jan-cerny
Copy link
Member Author

rebased on maint-1.3

@jan-cerny jan-cerny marked this pull request as ready for review July 16, 2021 07:14
Copy link
Contributor

@evgenyz evgenyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@evgenyz evgenyz merged commit 5f4c01c into OpenSCAP:maint-1.3 Jul 22, 2021
jan-cerny added a commit to jan-cerny/openscap that referenced this pull request Jul 28, 2021
The bug was a segmentation fault in filehash58 probe which happened
in openscap-1.3.3-6.el8_3.

The bug was fixed by OpenSCAP#1779
and this patch adds a very small test.
@jan-cerny jan-cerny added this to the 1.3.6 milestone Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants