xl2tpd-1.3.6+dfsg-2build1 periodically crashes if compiled with USE_KERNEL

Bug #1509183 reported by Ruslan Shelekhov
46
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Linux Mint
New
Undecided
Unassigned
xl2tpd (Debian)
Fix Released
Unknown
xl2tpd (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Ubuntu 15.04 x86_64

xl2tpd-1.3.6+dfsg-2build1 compiled from Ubuntu-supplied sources with adding OSFLAGS+= -DUSE_KERNEL to the Makefile

xl2pd daemon works very well and really uses kernel, so CPU usage is very low on my 450 Mbits-limited ISP uplink using L2TP

however, once in a day, randomly, xl2tpd crashes like this
xl2tpd[2414]: segfault at 188 ip 000000000040c7f8 sp 00007fffb1345280 error 4 in xl2tpd[400000+1c000]
wih dead ppp0 interface present but not working, staying for 2-3 min, then disappearing

looking into the code at the crash point reveals this in call.c line 416
---
#ifdef IP_ALLOCATION
    if (c->addr)
        unreserve_addr (c->addr);

    if (c->lns->localrange) // <-- this is the crash location
        unreserve_addr (c->lns->localaddr);
#endif
---

clearly c->lns is null pointer, so I patched this source a little:
---
    if (c->lns && c->lns->localrange)
        unreserve_addr (c->lns->localaddr);
---

compiled, installed and 1 week no crashes, no memory leaks and stable L2TP tunnel

this code introduced in patch 0003-Add-local-ip-range-option.patch and seems xl2tpd-1.3.6+dfsg-3 have same issue, the code of call.c is the same

seems problem exists in debian too
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760602

please consider a quick fix. thanks.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xl2tpd (Ubuntu):
status: New → Confirmed
Revision history for this message
Kaarle Ritvanen (kunkku) wrote :

This issue is still present in 16.04 LTS. Could the proposed patch be applied, or could xl2tpd be updated to the latest version (1.3.9)?

Revision history for this message
Kaarle Ritvanen (kunkku) wrote :

Still one clarification: I have installed xl2tpd from the 16.04 LTS repository (with no modifications), and I am still experiencing random crashes. Please consider updating the package or applying the patch.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Bug still present on Ubuntu 16.10. I get these crashes every time I disconnect from my VPN.

The Debian bug mentioned in the original description has a link to an upstream commit with the fix, which means the error should already be fixed in xl2tpd 1.3.7. Ubuntu 17.04 is going to have xl2tpd 1.3.8, so this bug should be gone once everyone upgrades.

Anyone who wants the fix to be backported to 16.04 LTS or 16.10 could probably help by preparing a SRU (https://wiki.ubuntu.com/StableReleaseUpdates).

tags: added: xenial
Changed in xl2tpd (Debian):
status: Unknown → Fix Released
Changed in xl2tpd (Ubuntu):
importance: Undecided → Medium
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.