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 1553406 - IKEv2 liveness false positive on IKEv2 idle connections causes tunnel to be restarted or taken down
Summary: IKEv2 liveness false positive on IKEv2 idle connections causes tunnel to be r...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libreswan
Version: 7.5
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Paul Wouters
QA Contact: Ondrej Moriš
URL:
Whiteboard:
Depends On:
Blocks: 1574457
TreeView+ depends on / blocked
 
Reported: 2018-03-08 19:40 UTC by Paul Wouters
Modified: 2018-10-30 10:52 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1574457 (view as bug list)
Environment:
Last Closed: 2018-10-30 10:51:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:3174 0 None None None 2018-10-30 10:52:02 UTC

Description Paul Wouters 2018-03-08 19:40:18 UTC
The DPD/liveness response is being ignored due to a bug, causing a false positive on liveness timeout.

The fix is in upstream commit ab38a8843fce42

Comment 3 Ondrej Moriš 2018-04-09 16:32:17 UTC
Paul, is there by any chance a test for this? Or can it be triggered by some of DPD tests?

Comment 4 Paul Wouters 2018-04-10 09:39:33 UTC
This should get triggered by regular DPD tests. send a few pings and idle the connection. It should not get torn down if the bug is resolved.

Comment 5 Tuomo Soini 2018-04-26 21:14:13 UTC
Use really fast dpd settings for testing

dpddelay=5
dpdtimeout=20
dpdaction=hold

After 20 seconds since last traffic over IPsec SA tunnel goes down without patch.

Comment 7 Ondrej Moriš 2018-06-07 13:10:46 UTC
Hmm, does this bug actually affect libreswan-3.23-3.el7 (RHEL-7.5.0)? It looks like I just cannot reproduce the issue or I simply do not see it. 

I have this connection between server and client:

server
======
conn test
    left=<server>
    right=<client>
    authby=secret 
    auto=add
    dpddelay=5
    dpdtimeout=20
    dpdaction=restart
    ikev2=insist

client
======
conn test
    left=<client>
    right=<server>
    authby=secret
    auto=add
    ikev2=insist
    dpddelay=5
    dpdtimeout=20
    dpdaction=clear

Both client and server is running libreswan-3.23-3.el7. When client establish connection - it keeps working complete lifetime, it is not restarted, it just works even though it is idle (no ping or anything), connection numbers are the same whole time (#1 for ISAKMP, #2 for IPSEC). Both sides are exchanging liveliness messages every 5 seconds as expected:

Jun  7 14:53:49.350345: | inserting event EVENT_v2_LIVENESS, timeout in 5.000 seconds for #2

Any hints how to trigger issue? Is it really present in RHEL-7.5?

Comment 8 Paul Wouters 2018-06-07 14:31:05 UTC
It is a bug only in 3.23 upstream, and the rhel build has libreswan-3.23-liveness-1553406.patch as of 3.23-4. So yes, 3.23-3 is broken for this.

Comment 9 Ondrej Moriš 2018-06-08 14:55:12 UTC
(In reply to Paul Wouters from comment #8)
> It is a bug only in 3.23 upstream, and the rhel build has
> libreswan-3.23-liveness-1553406.patch as of 3.23-4. So yes, 3.23-3 is broken
> for this.

Yes, I can see that 3.23-3 is missing that patch. But I simply do not see any liveness issues. DPD test cases behave the same way with 3.23-3 and 3.23-4. With idle connection liveness checks on client are working smoothly with 3.23-3 every 5 seconds (dpddelay=5):

...
#4 liveness_check - last_liveness: 93824.217, now: 93824.223 parent #3
#4 liveness_check - peer <server> is missing - giving them some time to come back
#4 liveness_check - peer <server> is ok schedule new
Received an INFORMATIONAL response, updating st_last_liveness, no pending_liveness

...
#4 liveness_check - last_liveness: 93829.218, now: 93829.225 parent #3
#4 liveness_check - peer <server> is missing - giving them some time to come back
#4 liveness_check - peer <server> ok schedule new
Received an INFORMATIONAL response, updating st_last_liveness, no pending_liveness
...

With 3.23-4:

...
#2 liveness_check - last_liveness: 94461.566, now: 94461.621 parent #1
#2 liveness_check - peer <server> is missing - giving them some time to come back
#2 liveness_check - peer <server> is ok schedule new
Received an INFORMATIONAL response; updating liveness, no longer pending.
Received an INFORMATIONAL response, updating st_last_liveness, no pending_liveness
...
#2 liveness_check - last_liveness: 94466.567, now: 94466.623 parent #1
#2 liveness_check - peer <server> is missing - giving them some time to come back
#2 liveness_check - peer <server> is ok schedule new
Received an INFORMATIONAL response; updating liveness, no longer pending.
Received an INFORMATIONAL response, updating st_last_liveness, no pending_liveness
...

Clearly I not saying that there is not a bug in 3.23-3, what I am trying to say is that the actual issue addressed by patch is probably more complicated that the one described in this bugzilla. Hence I cannot verify it properly, I can only verify it SanilyOnly (ie. just checking that patch is applied and no regression pops up).

Comment 10 Tuomo Soini 2018-06-08 15:08:10 UTC
It is more complicated. We didn't do deep analysis why that change broke dpd, just noticed it did and reverted it on upstream. It might also be possible that only breaks if there are multiple IPsec SAs (leftsubnets=, rightsubnets=). Or only if passive dpd is used (one end is sending dpd, other end is just responding)

Comment 11 Ondrej Moriš 2018-06-08 16:41:13 UTC
(In reply to Tuomo Soini from comment #10)
> It is more complicated. We didn't do deep analysis why that change broke
> dpd, just noticed it did and reverted it on upstream. It might also be
> possible that only breaks if there are multiple IPsec SAs (leftsubnets=,
> rightsubnets=). 

> Or only if passive dpd is used (one end is sending dpd,
> other end is just responding)

That's it! Finally I can clearly see it. Thanks a lot!

Comment 15 errata-xmlrpc 2018-10-30 10:51:34 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/RHEA-2018:3174


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