Bug 1477907 - Configuration reload (SIGHUP) opens two (never closed) new pipes in subprocess [rhel-7.3.z]
Configuration reload (SIGHUP) opens two (never closed) new pipes in subproces...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: keepalived (Show other bugs)
7.3
x86_64 Linux
urgent Severity urgent
: rc
: ---
Assigned To: Ryan O'Hara
Brandon Perkins
: Regression, ZStream
: 1477883 (view as bug list)
Depends On: 1464869
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-03 03:51 EDT by Oneata Mircea Teodor
Modified: 2018-01-25 07:58 EST (History)
7 users (show)

See Also:
Fixed In Version: keepalived-1.2.13-9.el7_3.1
Doc Type: Bug Fix
Doc Text:
Previously, open pipes were not closed properly when the keepalived process received the SIGHUP signal. As a consequence, every time keepalived received SIGHUP, two new pipes were created while the existing pipes were not closed. This bug has been fixed by using the pipe2() system call with the O_CLOEXEC flag. As a result, the number of open pipes no longer grows with every SIGHUP signal.
Story Points: ---
Clone Of: 1464869
Environment:
Last Closed: 2018-01-25 07:58:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0183 normal SHIPPED_LIVE keepalived bug fix update 2018-01-25 12:25:29 EST

  None (edit)
Description Oneata Mircea Teodor 2017-08-03 03:51:44 EDT
This bug has been copied from bug #1464869 and has been proposed to be backported to 7.3 z-stream (EUS).
Comment 3 Oneata Mircea Teodor 2017-08-03 03:52:53 EDT
*** Bug 1477883 has been marked as a duplicate of this bug. ***
Comment 4 Ryan O'Hara 2017-08-03 11:20:53 EDT
The fix here is two-part:

1. Add "@DEFS@" to the DEFS in lib/Makefile.in such that the HAVE_PIPE2 is used correctly at build time.

2. Add back a few lines of code that were removed in #1429880. Specifically, the code in signal_handler_destroy():

--      close(signal_pipe[1]);
--      close(signal_pipe[0]);
--      signal_pipe[1] = -1;
--      signal_pipe[0] = -1;
Comment 5 Ryan O'Hara 2017-08-03 11:36:42 EDT
Test results:

# rpm -q keepalived
keepalived-1.2.13-9.el7_3.1.x86_64

# keepalived -f /etc/keepalived/keepalived.conf 
# pstree -p $( cat /var/run/keepalived.pid )
keepalived(34937)─┬─keepalived(34938)
                                 └─keepalived(34939)

# lsof | grep 34937 | grep pipe | wc -l
2
# lsof | grep 34938 | grep pipe | wc -l
2
# lsof | grep 34939 | grep pipe | wc -l
2

# kill -HUP $( cat /var/run/keepalived.pid )

# lsof | grep 34937 | grep pipe | wc -l
2
# lsof | grep 34938 | grep pipe | wc -l
2
# lsof | grep 34939 | grep pipe | wc -l
2

Note that after SIGHUP each process should have exactly 2 pipes open. This is correct.
Comment 12 errata-xmlrpc 2018-01-25 07:58:25 EST
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, 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-2018:0183

Note You need to log in before you can comment on or make changes to this bug.