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 1368728 - Keepalive don't assign virtual ip and report libc2.7 error on messages
Summary: Keepalive don't assign virtual ip and report libc2.7 error on messages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: keepalived
Version: 7.1
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Ryan O'Hara
QA Contact: Brandon Perkins
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-20 18:27 UTC by Christian Marangoni
Modified: 2017-08-01 19:36 UTC (History)
2 users (show)

Fixed In Version: keepalived-1.3.5-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 19:36:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch for keepalived-1.2.13-7 (3.35 KB, patch)
2016-10-20 17:48 UTC, Richard D Alloway
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2169 0 normal SHIPPED_LIVE keepalived bug fix and enhancement update 2017-08-01 18:18:21 UTC

Description Christian Marangoni 2016-08-20 18:27:45 UTC
Description of problem:

When you setup keepalived on rh  7.1 and don't enter smtp server on global_def, keepalived dosen't work and continue to loop  and report some libc 2.7 error ad the assign of the ip already setup on network device not the "virtual" on  /var/log/messages


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

Red Hat enterprise Linux 7.1

keepalived-1.2.13-6.el7.x86_64
or
keepalived-1.2.13-7.el7.x86_64


How reproducible:

Install and configure keepalived without insert a value for smtp_server 


Actual results:
Don't work with smtp_server value

Expected results:

work with smtp_server value

Additional info:

errorlog /var/log/messages

 DPI208 kernel: keepalived[12486]: segfault at 7f0a00726570 ip 00007f0a2fd0fe84 sp 00007fff0739b0c8 error 4 in libc-2.17.so[7f0a2fbde000+1b6000]
 DPI208 kernel: keepalived[12487]: segfault at 7f0a00726570 ip 00007f0a2fd0fe84 sp 00007fff0739b0c8 error 4 in libc-2.17.so[7f0a2fbde000+1b6000]
 DPI208 Keepalived_healthcheckers[12488]: Netlink reflector reports IP 10.100.2.208 added
 DPI208 Keepalived_healthcheckers[12488]: Registering Kernel netlink reflector
 DPI208 Keepalived_healthcheckers[12488]: Registering Kernel netlink command channel
 DPI208 Keepalived_healthcheckers[12488]: Opening file '/etc/keepalived/keepalived.conf'.
 DPI208 Keepalived[2490]: Healthcheck child process(12488) died: Respawning
 Keepalived[2490]: Starting Healthcheck child process, pid=12489
 kernel: keepalived[12488]: segfault at 7f0a00726570 ip 00007f0a2fd0fe84 sp 00007fff0739b0c8 error 4 in libc-2.17.so[7f0a2fbde000+1b6000]

Comment 2 Richard D Alloway 2016-10-20 17:47:19 UTC
I was able to replicate the issue and have resolved it with a patch that I will attach momentarily.

The issue was that having a configuration item without a value assigned creates a vector, but the token in slot 1 is not initialized/populated and therefore points to NULL.

The existing vector_ensure() function performs a check and, if the token isn't initialized, it is created and set to NULL. 

So, I call vector_ensure() and then verify that vector_slot() return a non-NULL value before using vector_slot().

In addition to resolving this issue with smtp_server, I found that the same problem is present with notification_email_from and smtp_connect_timeout, so the patch addresses these two, also.

-Rich Alloway (RogueWave)

Comment 3 Richard D Alloway 2016-10-20 17:48:45 UTC
Created attachment 1212600 [details]
Proposed patch for keepalived-1.2.13-7

Comment 4 Ryan O'Hara 2016-10-20 19:32:56 UTC
(In reply to Richard D Alloway from comment #3)
> Created attachment 1212600 [details]
> Proposed patch for keepalived-1.2.13-7

(In reply to Richard D Alloway from comment #2)
> I was able to replicate the issue and have resolved it with a patch that I
> will attach momentarily.
> 
> The issue was that having a configuration item without a value assigned
> creates a vector, but the token in slot 1 is not initialized/populated and
> therefore points to NULL.
> 
> The existing vector_ensure() function performs a check and, if the token
> isn't initialized, it is created and set to NULL. 
> 
> So, I call vector_ensure() and then verify that vector_slot() return a
> non-NULL value before using vector_slot().
> 
> In addition to resolving this issue with smtp_server, I found that the same
> problem is present with notification_email_from and smtp_connect_timeout, so
> the patch addresses these two, also.
> 
> -Rich Alloway (RogueWave)

The problem exists for any config file keyword that expects a value where none is set. The parser does not detect this as it should. I've discussed this with upstream and I believe we have a simple patch that will address this problem, such that an error will be printed and keepalived will exit. That said, I will take a look at this patch.

Comment 5 Ryan O'Hara 2016-10-20 19:33:24 UTC
(In reply to Richard D Alloway from comment #3)
> Created attachment 1212600 [details]
> Proposed patch for keepalived-1.2.13-7

This is only a diff of the spec file.

Comment 6 Richard D Alloway 2016-10-20 19:55:34 UTC
Hi Ryan!

There is a new file created as SOURCES/bz1368728-keepalived-config-segfault.patch towards the top of the patch file.

The spec file diff is below the patch.

Let me know if you can't see it and I'll upload the file again.

Thanks!

-Rich

Comment 7 Ryan O'Hara 2016-10-20 22:06:38 UTC
(In reply to Richard D Alloway from comment #6)
> Hi Ryan!
> 
> There is a new file created as
> SOURCES/bz1368728-keepalived-config-segfault.patch towards the top of the
> patch file.
> 
> The spec file diff is below the patch.
> 
> Let me know if you can't see it and I'll upload the file again.
> 
> Thanks!
> 
> -Rich

OK. I see it now. For some reason if I click the diff link in the above comment I only see the spec file diff. The patch looks fine, but I would much prefer we fix the bigger issue with all keyword/value pairs. Between upstream and myself, if that doesn't happen soon I will use this patch as a temporary fix in RHEL. Thanks.

Comment 8 Ryan O'Hara 2017-03-27 17:22:23 UTC
I tested this today and it is fixed in keepalived-1.3.5, which will released with RHEL7.4.

In the "global_defs" section of /etc/keepalived/keepalived.conf, simple add "smtp_server" without specifying the required name/address. Start keepalived, there will be no segfault. Instead, keepalived shoud fail to start and the following messages should appear in the logs:

*** Configuration line starting `smtp_server` is missing a parameter after keyword `smtp_server` at word position 2

Comment 11 errata-xmlrpc 2017-08-01 19:36:38 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, 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-2017:2169


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