strongSwan 5.3.5 has a known incompatibility with iOS/macOS 10+

Bug #1687711 reported by dguido
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
strongswan (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Medium
Unassigned
Yakkety
Fix Released
Medium
Unassigned

Bug Description

[Impact]

 * iOS10+/MacOS10+ devices fail at dead peer detection and re-establish
   the connection over and over

 * Backport of upstream fix.

[Test Case]

 * Set up strongswan (the reporter did so via algo, but other preferred
   setups are good as well) and prepare iOS10+ devices to dial in.

 * check for the reconnects to start based on broken dead peer detection

[Regression Potential]

 * Due to the fact that this is a backport there could be dependencies to
   the newer code. The change isn't too bug and it looks safe, as well as
   compiling and regression testing fine - but if we want to look out for
   regressions that certainly is the biggest potential one.
 * From the behavior change itself it should be safe, to quote from
   upstream "If a responder is natted it will usually be a static NAT
   (unless it's a mediated connection) in which case adding these notifies
   makes not much sense (if the initiator's NAT mapping had changed the
   responder wouldn't be able to reach it anyway).

[Other Info]

 * I can do general regression check, but for the actual issue
   verification I lack the apple devices and have to rely on the reporters
   (fortunately two active on the bug now, and confirmed on the ppa
   already)

---

Original bug asked to backport the full newer release, but given SRU policy and that it seems to be fixable with much smaller change we decided for a backported patch - keeping original content below:

---

strongSwan is effectively incompatible with iOS 10+ and macOS 10.11+ devices. Dead peer detection does not work for these devices and they continually re-establish security associations (SAs) as a result. Please see the issues described in further detail below:

strongSwan confirmed the issue and patched it in 5.5.1:
https://wiki.strongswan.org/issues/2126

strongSwan recommends a workaround that breaks other functionality:
https://wiki.strongswan.org/projects/strongswan/wiki/AppleClients#IKEv2-on-iOS-9-and-iOS-10

Ubuntu 17.04 has packaged strongSwan 5.5.1 which fixes this issue. I would recommend an SRU for strongSwan 5.3.5 to 5.5.1 in Ubuntu 16.04.

[Impact]
Ubuntu users are running into this bug in normal usage:
https://github.com/trailofbits/algo/issues/430

[Test Case]
In order to test this issue:
1. Deploy an Ubuntu 16.04 server with strongSwan via Algo (https://github.com/trailofbits/algo)
2. Connect an iOS client
3. Wait a few minutes for the reconnects to start based on broken dead peer detection

In order to test the fix for this issue:
1. Deploy an Ubuntu 17.04 server with strongSwan via Algo (modify config.cfg to select 17.04)
2. Connect an iOS client
3. Wait the same time period as before and notice that the connection does not drop

[Regression Potential]
strongSwan and IPSEC software in general change at a very slow rate. In our tests with Algo, the exact same ipsec.conf and related configuration work for strongSwan 5.5.1 that worked for 5.3.5.

dguido (dguido)
description: updated
description: updated
description: updated
description: updated
dguido (dguido)
description: updated
dguido (dguido)
description: updated
Revision history for this message
Defunct (defunctio) wrote :

I can confirm that the `strongswan-5.5.1-1ubuntu3` source package from 17.04 compiles without issue on 16.04. There is one missing build-dep `libsystemd-dev` however. I've experienced no functionality or stability issues so far.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I'm only now reading into details, but in general just taking 5.5.1 can be a backport but not easily an SRU.
We have to check if there is a way to find a minimal amount of changes to SRU them.

Changed in strongswan (Ubuntu):
status: New → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

We might try if [1] applies and fixes the issue without all the major changes that 5.5.1 would imply.

[1]: https://wiki.strongswan.org/projects/strongswan/repository/revisions/33241871a82a0c374128373e47380be60f0431fa/diff

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The following is a bit of a quick shot but maybe good for your to verify.
I backported the change I identified to Xenial (eventually Y is needed as well).

The package starts building in:
  https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/2752

If you could try and verify if that fixes the issue that would be great.

Revision history for this message
dguido (dguido) wrote :

Thanks, I will test the package you provided soon and get back to you with the results.

In the meantime, we have setup Algo to pull in strongSwan packages from 17.04. This has not caused any issues: https://github.com/trailofbits/algo/pull/515/files

Changed in strongswan (Ubuntu Xenial):
status: New → Confirmed
Changed in strongswan (Ubuntu Yakkety):
status: New → Confirmed
Changed in strongswan (Ubuntu Xenial):
importance: Undecided → Medium
Changed in strongswan (Ubuntu Yakkety):
importance: Undecided → Medium
Revision history for this message
Simon Déziel (sdeziel) wrote :

I was able to reproduce the problematic scenario with an iOS 10.3.1 client and I'm happy to say that 5.3.5-1ubuntu3.2 [*] fixes it. Thanks Christian!

*: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/2752

tags: added: server-next
Changed in strongswan (Ubuntu Xenial):
status: Confirmed → Triaged
Changed in strongswan (Ubuntu Yakkety):
status: Confirmed → Triaged
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for the check, I also couldn't find anything too obviously broken.
I'm prepping Yakkety as well now and if things go well would put it to the SRU queue later.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Updated SRU template, matching that we intend to fix the issue now and not as initially requested backport the full newer strongswan.

description: updated
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Ok, all tests succeeded as well, so I'd think this is good for SRU - so I pushed it to unapproved for Xenial and Yakkety.

Please help me testing -proposed once it appears there.

Note (to myself) - related bileto tickets:
https://bileto.ubuntu.com/#/ticket/2752
https://bileto.ubuntu.com/#/ticket/2761

Changed in strongswan (Ubuntu Xenial):
status: Triaged → Fix Committed
Changed in strongswan (Ubuntu Yakkety):
status: Triaged → Fix Committed
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello dguido, or anyone else affected,

Accepted strongswan into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/strongswan/5.3.5-1ubuntu4.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello dguido, or anyone else affected,

Accepted strongswan into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/strongswan/5.3.5-1ubuntu3.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Simon Déziel (sdeziel) wrote :

5.3.5-1ubuntu3.2 from xenial-proposed fixes the issue.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks Simon, do you (or dguido) have a chance to test on Yakkety as well or would that be too much setup effort?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Also found no other things in Xenial and autopkgtests are fine on X&Y.
Seting v-done for xenial, but yakkety has to be checked one with the right devices (and setup).

tags: added: verification-done-xenial
Revision history for this message
Simon Déziel (sdeziel) wrote : Re: [Bug 1687711] Re: strongSwan 5.3.5 has a known incompatibility with iOS/macOS 10+

On 2017-05-17 01:35 AM, ChristianEhrhardt wrote:
> Thanks Simon, do you (or dguido) have a chance to test on Yakkety as
> well or would that be too much setup effort?

I don't have any (interest in) Yakkety but I'll give it a try since you
took the time to prepare a SRU.

Simon

Revision history for this message
Simon Déziel (sdeziel) wrote :

With a Yakkety server running 5.3.5-1ubuntu4.1 and an iOS 10.3.2 client, I can reproduce the issue.
The package from -proposed (5.3.5-1ubuntu4.2) fixes the issue, thanks Christian!

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

On Thu, May 18, 2017 at 2:21 AM, Simon Déziel <email address hidden>
wrote:

> With a Yakkety server running 5.3.5-1ubuntu4.1 and an iOS 10.3.2 client, I
> can reproduce the issue.
> The package from -proposed (5.3.5-1ubuntu4.2) fixes the issue, thanks
> Christian!
>

Thank you so much Simon,
I have a note here in my office which is titled "Beer for people if I ever
meet them", you just scored a +1 there!

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package strongswan - 5.3.5-1ubuntu3.2

---------------
strongswan (5.3.5-1ubuntu3.2) xenial; urgency=medium

  * d/p/ikev2-Only-add-NAT-D-notifies-to-DPDs-as-initiator.patch: fix issue
    related to DPD vs iOS10 (LP: #1687711)

 -- Christian Ehrhardt <email address hidden> Wed, 03 May 2017 17:37:06 +0200

Changed in strongswan (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for strongswan has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package strongswan - 5.3.5-1ubuntu4.2

---------------
strongswan (5.3.5-1ubuntu4.2) yakkety; urgency=medium

  * d/p/ikev2-Only-add-NAT-D-notifies-to-DPDs-as-initiator.patch: fix issue
    related to DPD vs iOS10 (LP: #1687711)

 -- Christian Ehrhardt <email address hidden> Mon, 15 May 2017 07:48:30 +0200

Changed in strongswan (Ubuntu Yakkety):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.