kernel-libipsec not loading

Bug #1309594 reported by Tony Zhou
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
strongswan (Ubuntu)
Fix Released
Medium
Jonathan Davies
Trusty
Won't Fix
Undecided
Unassigned

Bug Description

Hi,

I'm running Ubuntu 14.04 and installed Strongswan 5.1.2 with strongswan-plugin-kernel-libipsec. The problem is that the plugin kernel-libipsec is not loading even if /etc/strongswan.d/charon/kernel-libipsec.conf has the option "load = yes" been set. Also in syslog it seems that strongswan is not even looking for that plugin.

Here's the log:

Apr 18 11:20:54 vpn charon: 00[DMN] Starting IKE charon daemon (strongSwan 5.1.2, Linux 3.13.0-24-generic, i686)
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'test-vectors': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'aes': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'rc2': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'sha1': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'sha2': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'md4': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'md5': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'random': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'nonce': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'x509': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'revocation': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'constraints': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'pkcs1': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'pkcs7': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'pkcs8': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'pkcs12': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'pem': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] Padlock not found, CPU is GenuineIntel
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'padlock': failed to load - padlock_plugin_create returned NULL
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'openssl': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'xcbc': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'cmac': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'hmac': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'ctr': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'ccm': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'gcm': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'attr': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'kernel-netlink': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'resolve': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'socket-default': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'stroke': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'updown': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'eap-identity': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'eap-radius': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'eap-ttls': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'xauth-eap': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] plugin 'addrblock': loaded successfully
Apr 18 11:20:54 vpn charon: 00[LIB] feature PUBKEY:DSA in plugin 'pem' has unmet dependency: PUBKEY:DSA
Apr 18 11:20:54 vpn charon: 00[LIB] feature PRIVKEY:DSA in plugin 'pem' has unmet dependency: PRIVKEY:DSA
Apr 18 11:20:54 vpn charon: 00[LIB] feature CERT_DECODE:PGP in plugin 'pem' has unmet dependency: CERT_DECODE:PGP
Apr 18 11:20:54 vpn charon: 00[LIB] feature CERT_DECODE:X509_OCSP_REQUEST in plugin 'pem' has unmet dependency: CERT_DECODE:X509_OCSP_REQUEST
Apr 18 11:20:54 vpn charon: 00[LIB] feature CERT_DECODE:TRUSTED_PUBKEY in plugin 'pem' has unmet dependency: CERT_DECODE:TRUSTED_PUBKEY
Apr 18 11:20:54 vpn charon: 00[CFG] loading ca certificates from '/etc/ipsec.d/cacerts'
Apr 18 11:20:54 vpn charon: 00[CFG] loaded ca certificate "C=, O=, CN=" from '/etc/ipsec.d/cacerts/caCert.pem'
Apr 18 11:20:54 vpn charon: 00[CFG] loading aa certificates from '/etc/ipsec.d/aacerts'
Apr 18 11:20:54 vpn charon: 00[CFG] loading ocsp signer certificates from '/etc/ipsec.d/ocspcerts'
Apr 18 11:20:54 vpn charon: 00[CFG] loading attribute certificates from '/etc/ipsec.d/acerts'
Apr 18 11:20:54 vpn charon: 00[CFG] loading crls from '/etc/ipsec.d/crls'
Apr 18 11:20:54 vpn charon: 00[CFG] loading secrets from '/etc/ipsec.secrets'
Apr 18 11:20:54 vpn charon: 00[CFG] loaded RSA private key from '/etc/ipsec.d/private/serverKey.pem'
Apr 18 11:20:54 vpn charon: 00[CFG] loaded IKE secret for %any
Apr 18 11:20:54 vpn charon: 00[LIB] loaded plugins: charon test-vectors aes rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pkcs1 pkcs7 pkcs8 pkcs12 pem openssl xcbc cmac hmac ctr ccm gcm attr kernel-netlink resolve socket-default stroke updown eap-identity eap-radius eap-ttls xauth-eap addrblock
Apr 18 11:20:54 vpn charon: 00[LIB] unable to load 5 plugin features (5 due to unmet dependencies)
Apr 18 11:20:54 vpn charon: 00[LIB] dropped capabilities, running as uid 0, gid 0
Apr 18 11:20:54 vpn charon: 00[JOB] spawning 16 worker threads
Apr 18 11:20:54 vpn charon: 07[LIB] created thread 07 [17798]
Apr 18 11:20:54 vpn charon: 08[LIB] created thread 08 [17799]
Apr 18 11:20:54 vpn charon: 09[LIB] created thread 09 [17800]
Apr 18 11:20:54 vpn charon: 10[LIB] created thread 10 [17801]
Apr 18 11:20:54 vpn charon: 11[LIB] created thread 11 [17802]
Apr 18 11:20:54 vpn charon: 12[LIB] created thread 12 [17803]
Apr 18 11:20:54 vpn charon: 13[LIB] created thread 13 [17804]
Apr 18 11:20:54 vpn charon: 15[LIB] created thread 15 [17806]
Apr 18 11:20:54 vpn charon: 14[LIB] created thread 14 [17805]
Apr 18 11:20:54 vpn charon: 16[LIB] created thread 16 [17807]
Apr 18 11:20:54 vpn charon: 06[LIB] created thread 06 [17797]
Apr 18 11:20:54 vpn charon: 05[LIB] created thread 05 [17796]
Apr 18 11:20:54 vpn charon: 04[LIB] created thread 04 [17795]
Apr 18 11:20:54 vpn charon: 03[LIB] created thread 03 [17794]
Apr 18 11:20:54 vpn charon: 02[LIB] created thread 02 [17793]
Apr 18 11:20:54 vpn charon: 01[LIB] created thread 01 [17792]

Thanks,
TZ

Tags: patch
Revision history for this message
Jonathan Davies (jpds) wrote :
Jonathan Davies (jpds)
Changed in strongswan (Ubuntu):
status: New → Confirmed
Revision history for this message
Tony Zhou (ttzforj) wrote :

Personally, I doubt if it is an upstream problem, since I previously compiled the source code from strongswan.org and that can load kernel-libipsec properly...

Revision history for this message
Martin Willi (martinwilli) wrote :

AFAICS, kernel-libipsec is not part of the Ubuntu strongSwan package, hence it can't be enabled.

Not sure if there are that many uses cases for kernel-libipsec on a standard Linux distribution to justify its inclusion; kernel-netlink is preferable on >95% of use cases.

Regards
Martin

Revision history for this message
Tobias Brunner (tobias-strongswan) wrote :

While debian/strongswan-plugin-kernel-libipsec.install lists usr/lib/ipsec/plugins/libstrongswan-kernel-libipsec.so the strongswan-plugin-kernel-libipsec package does not actually include that file.

The reason for this is how dh_install is called in debian/rules, due to the -Xlibstrongswan-kernel option all kernel plugins are excluded from the packages. The kernel-netlink/pfroute/pfkey plugins are added manually to the libstrongswan package depending on the target platform (i.e. FreeBSD vs. Linux). I suppose something similar could be done to add the kernel-libipsec plugin to the plugin-kernel-libipsec package.

Revision history for this message
Tony Zhou (ttzforj) wrote :

Hi Martin,

strongswan-plugin-kernel-libipsec does provide the plugin (or supposedly) in Ubuntu 14.04.

There are two reasons (or at least mine) to use kernel-libipsec, one is that kernel-libipsec provides a separate interface so that filtering/inspecting the packets would be easier with iptables, and second is that for OpenVZ-based platforms, kernel-libipsec is necessary to make both L2TP/IPSec and IKEv1 to work properly simultaneously (although for L2TP case tunnel mode must be used). I have tested that kernel-netlink alone will fail to forward the packets between the gateway and IKEv1 clients.

Best,
TZ

Jonathan Davies (jpds)
Changed in strongswan (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → Medium
assignee: nobody → Jonathan Davies (jpds)
Revision history for this message
Simon Déziel (sdeziel) wrote :

@ttzforj, I understand the need for a userspace implementation when using OpenVZ (LXC too?) but for iptables, are you aware of the policy module? I find it very useful and relatively easy to use:

  # Allow only SSH when over IPsec
  iptables -A INPUT -p tcp --dport 22 -m policy --dir in --pol ipsec -j ACCEPT
  iptables -A INPUT -p tcp --dport 22 -j REJECT

Regards,
Simon

Revision history for this message
Tony Zhou (ttzforj) wrote :

Hello Simon,

Yes I know the policy module. However I think on OpenVZ, strongswan is unable to forward ipsec traffic to proper interface, which I believe it is an upstream problem: https://wiki.strongswan.org/issues/592

Thanks,
TZ

Revision history for this message
Simon Déziel (sdeziel) wrote : Re: [Bug 1309594] Re: kernel-libipsec not loading

Hi Tony

On 09/18/2014 11:28 AM, Tony Zhou wrote:
> However I think on OpenVZ, strongswan is unable to forward ipsec
> traffic to proper interface, which I believe it is an upstream
> problem: https://wiki.strongswan.org/issues/592

This is getting off-topic but I only ever tried to run IPsec in the HW
node context and protect traffic for the VEs. This required disabling
this in the *VE*: sysctl net.ipv4.conf.venet0.disable_policy=1

HTH,
Simon

Revision history for this message
Richard Laager (rlaager) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "A patch to fix the kernel-libipsec plugin packaging." seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Janis Jansons (janhouse) wrote :

I wonder why this is not fixed in official Ubuntu repos yet.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (14.3 KiB)

This bug was fixed in the package strongswan - 5.3.5-1ubuntu1

---------------
strongswan (5.3.5-1ubuntu1) xenial; urgency=medium

  * debian/{rules,control,libstrongswan-extra-plugins.install}
    Enable bliss plugin
  * debian/{rules,control,libstrongswan-extra-plugins.install}
    Enable chapoly plugin
  * debian/patches/dont-load-kernel-libipsec-plugin-by-default.patch
    Upstream suggests to not load this plugin by default as it has
    some limitations.
    https://wiki.strongswan.org/projects/strongswan/wiki/Kernel-libipsec
  * debian/patches/increase-bliss-test-timeout.patch
    Under QEMU/KVM for autopkgtest bliss test takes a bit longer then default
  * Update Apparmor profiles
    - usr.lib.ipsec.charon
      - add capability audit_write for xauth-pam (LP: #1470277)
      - add capability dac_override (needed by agent plugin)
      - allow priv dropping (LP: #1333655)
      - allow caching CRLs (LP: #1505222)
      - allow rw access to /dev/net/tun for kernel-libipsec (LP: #1309594)
    - usr.lib.ipsec.stroke
      - allow priv dropping (LP: #1333655)
      - add local include
    - usr.lib.ipsec.lookip
      - add local include
  * Merge from Debian, which includes fixes for all previous CVEs
    Fixes (LP: #1330504, #1451091, #1448870, #1470277)
    Remaining changes:
      * debian/control
        - Lower dpkg-dev to 1.16.1 from 1.16.2 to enable backporting to Precise
        - Update Maintainer for Ubuntu
        - Add build-deps
          - dh-apparmor
          - iptables-dev
          - libjson0-dev
          - libldns-dev
          - libmysqlclient-dev
          - libpcsclite-dev
          - libsoup2.4-dev
          - libtspi-dev
          - libunbound-dev
        - Drop build-deps
          - libfcgi-dev
          - clearsilver-dev
        - Create virtual packages for all strongswan-plugin-* for dist-upgrade
        - Set XS-Testsuite: autopkgtest
      * debian/rules:
        - Enforcing DEB_BUILD_OPTIONS=nostrip for library integrity checking.
        - Set TESTS_REDUCED_KEYLENGTHS to one generate smallest key-lengths in
          tests.
        - Change init/systemd program name to strongswan
        - Install AppArmor profiles
        - Removed pieces on 'patching ipsec.conf' on build.
        - Enablement of features per Ubuntu current config suggested from
          upstream recommendation
        - Unpack and sort enabled features to one-per-line
        - Disable duplicheck as per
          https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718291#10
        - Disable libfast (--disable-fast):
          Requires dropping medsrv, medcli plugins which depend on libfast
        - Add configure options
          --with-tss=trousers
        - Remove configure options:
          --enable-ha (requires special kernel)
          --enable-unit-test (unit tests run by default)
        - Drop logcheck install
      * debian/tests/*
        - Add DEP8 test for strongswan service and plugins
      * debian/strongswan-starter.strongswan.service
        - Add new systemd file instead of patching upstream
      * debian/strongswan-starter.links
        - removed, use Ubuntu systemd file instead of linking to upstream
      * debia...

Changed in strongswan (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Christian Thiemann (thiemann) wrote :

Not fixed in Ubuntu 14.04, still need to compile from strongswan source package with the patch from comment #9.

Revision history for this message
Robie Basak (racb) wrote :

This seems unlikely to be fixed in Trusty now. If someone wants to drive this (prepare a minimal backport, etc), then please comment and reopen.

Changed in strongswan (Ubuntu Trusty):
status: New → Won't Fix
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.