Bug 2042345

Summary: systemd reports usbguard.service: Supervising process 1059 which is not our child. We'll most likely not notice when it exits.
Product: Red Hat Enterprise Linux 9 Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: usbguardAssignee: Attila Lakatos <alakatos>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: unspecified Docs Contact: Jan Fiala <jafiala>
Priority: unspecified    
Version: 9.0CC: dapospis, rsroka
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: usbguard-1.0.0-13.el9 Doc Type: Bug Fix
Doc Text:
.USBGuard no longer causes a confusing warning Previously, a race condition could happen in USBGuard when a parent process finished sooner than the first child process. As a consequence, `systemd` reported that a process was present with a wrongly identified parent PID (PPID). With this update, a parent process waits for the first child process to finish in working mode. As a result, `systemd` no longer reports such warnings.
Story Points: ---
Clone Of:
: 2159409 (view as bug list) Environment:
Last Closed: 2023-05-09 07:48:17 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:
Bug Depends On:    
Bug Blocks: 2159409    
Deadline: 2023-01-10   

Description Jan Pazdziora (Red Hat) 2022-01-19 09:59:41 UTC
Description of problem:

Sometimes, journal has message

  systemd: usbguard.service: Supervising process 1059 which is not our child. We'll most likely not notice when it exits.

in it.

Version-Release number of selected component (if applicable):

usbguard-1.0.0-10.el9.aarch64

How reproducible:

Very non-deterministic.

Steps to Reproduce:
1. Have usbguard.service enabled.
2. Boot the system.
3. Check journal for "Supervising process"

Actual results:

  systemd: usbguard.service: Supervising process 1059 which is not our child. We'll most likely not notice when it exits.

Expected results:

No such message.

Additional info:

Comment 1 Jan Pazdziora (Red Hat) 2022-01-19 10:11:28 UTC
I have a reason to believe that this is caused by a race condition in Daemon::daemonize
(upstream currently at https://github.com/USBGuard/usbguard/blob/master/src/Daemon/Daemon.cpp#L586).

When the initial process exits (based on that SIGUSR1 that it got) before the first forked process exits, the second forked process whose pid got written to pid_file still has ppid that first forked process. So when systemd checks the ppid for the pid found in the /run/usbguard.pid, it still sees that first forked child, not self.

Comment 15 errata-xmlrpc 2023-05-09 07:48:17 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 (usbguard bug fix and enhancement update), 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-2023:2351