Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2019054

Summary: oscap-chroot (process58 probe) errors when scanning minimalist filesystem
Product: Red Hat Enterprise Linux 9 Reporter: Evgeny Kolesnikov <ekolesni>
Component: openscapAssignee: Evgeny Kolesnikov <ekolesni>
Status: CLOSED ERRATA QA Contact: Matus Marhefka <mmarhefk>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: ekolesni, jcerny, mhaicman, mmarhefk, qe-baseos-security
Target Milestone: rcKeywords: Triaged
Target Release: 9.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openscap-1.3.5-11.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2008922 Environment:
Last Closed: 2022-05-17 13:04:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Evgeny Kolesnikov 2021-11-01 14:26:03 UTC
+++ This bug was initially created as a clone of Bug #2008922 +++

Description of problem:
When scanning `oval:ssg-agent_mfetpd_running:def:1` on a minimalist filesystem oscap-chroot errors and evaluates the OVAL definition as unknown. Reason of this behavior is that the scanned filesystem contains empty /proc directory.


Version-Release number of selected component (if applicable):
openscap-1.3.5-6.el8.x86_64
scap-security-guide-0.1.57-5.el8.noarch


How reproducible:
always


Steps to Reproduce:
1. mkdir -p /chroot_dir && mkdir -p /chroot_dir/var/lib/rpm
2. rpm --root /chroot_dir --initdb
3. yum -y --installroot="/chroot_dir" install redhat-release filesystem yum rpm bash coreutils util-linux
4. oscap-chroot /chroot_dir oval eval --id oval:ssg-agent_mfetpd_running:def:1 /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml


Actual results:
W: oscap:     Can't receive message: 125, Operation canceled.
E: oscap:     Recv: retry limit (0) reached.
OpenSCAP Error: Probe at sd=1 (process58) reported an error: Operation not permitted [/builddir/build/BUILD/openscap-1.3.5/src/OVAL/oval_probe_ext.c:384]
Unable to receive a message from probe [/builddir/build/BUILD/openscap-1.3.5/src/OVAL/oval_probe_ext.c:572]
Invalid oval result type: -1. [/builddir/build/BUILD/openscap-1.3.5/src/OVAL/results/oval_resultTest.c:181]


Expected results:
This is up to discussion, but oscap should not error like this. Maybe we can make the probe more intelligent so it prints a warning message that /proc filesystem is not available and that results could not be obtained.


Additional info:

--- Additional comment from Jan Černý on 2021-10-05 07:13:40 UTC ---

Analysis:

The OpenSCAP process58 probe doesn't assume empty /proc directory, it's written in a way that if it doesn't find any directory with numerical name under /proc it considers it a permissions problem so the probe returns PROBE_EACCESS which leads to the error "Operation not permitted". 

The code in the `static int read_process` function needs to be adjusted to count with the situation described in this BZ and the return values of the function need to be changed in the situation.

--- Additional comment from Jan Černý on 2021-10-05 12:47:54 UTC ---

PR has been submitted to upstream for discussion and review: https://github.com/OpenSCAP/openscap/pull/1812

--- Additional comment from Evgeny Kolesnikov on 2021-11-01 11:28:26 UTC ---

Merged upstream.

Comment 9 errata-xmlrpc 2022-05-17 13:04:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: openscap), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2449