Skip to content

[backport] Serialize the filehash DoS tests - #2465

Merged
matusmarhefka merged 1 commit into
OpenSCAP:maint-1.3from
jan-cerny:backport_2456
Oct 22, 2026
Merged

matusmarhefka merged 1 commit into
OpenSCAP:maint-1.3from
jan-cerny:backport_2456

Conversation

@jan-cerny

Copy link
Copy Markdown
Member

This PR is a backport of the PR #2456 to the maint-1.3 branch.

test_probes_filehash_dos.sh and test_probes_filehash58_dos.sh both create and remove /tmp/oscap-test-fifo and /tmp/oscap-test-symlink, the paths their OVAL definitions name. Under ctest -j, when both run, one removes the files the other is about to read, or fails to create a file the other just made. A RESOURCE_LOCK on both runs them one at a time. The filehash test exists only with OPENSCAP_ENABLE_SHA1 and OPENSCAP_ENABLE_MD5 on, both off by default.

Built with both on, 50 runs of ctest -j2 over the two tests on Fedora 44 failed twice on main, each time in test_probes_filehash58_dos.sh 0.3 seconds in. With this change the 50 runs passed.

test_probes_filehash_dos.sh and test_probes_filehash58_dos.sh both
create and remove /tmp/oscap-test-fifo and /tmp/oscap-test-symlink,
the paths their OVAL definitions name. Under ctest -j, when both run,
one removes the files the other is about to read, or fails to create
a file the other just made. A RESOURCE_LOCK on both runs them one at a
time. The filehash test exists only with OPENSCAP_ENABLE_SHA1 and
OPENSCAP_ENABLE_MD5 on, both off by default.

Built with both on, 50 runs of ctest -j2 over the two tests on Fedora
44 failed twice on main, each time in test_probes_filehash58_dos.sh 0.3
seconds in. With this change the 50 runs passed.
@jan-cerny jan-cerny added this to the 1.3.16 milestone Oct 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

@matusmarhefka
matusmarhefka merged commit 969b7f0 into OpenSCAP:maint-1.3 Oct 22, 2026
11 checks passed
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.

3 participants