SIP auth fails with gcc 5.x build

Bug #1497871 reported by Ryan Murray
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sflphone (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

With gcc 5.x, valgrind indicates that the SIP password is pointing at
a value on the stack in a different function. The use of the temporary
std::string on the stack causes the cred_[i].data assignment to point to
a stack address, that isn't be valid by the time the password is needed
to do auth. This fixes the password pointer to be like the other auth
strings set in this function, and fixes SIP auth.

Tags: patch
Revision history for this message
Ryan Murray (ubuntu-hz) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix_auth.patch" 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
Daniel Holbach (dholbach) wrote :
Download full text (17.1 KiB)

I created a debdiff for the patch, but unfortunately it fails to build:

-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found GCC version >= 4.8: 5.2.1

cmake install prefix is : /usr
-- Found Qt4: /usr/bin/qmake (found suitable version "4.8.6", minimum required is "4.8.0")
-- Found Qt-Version 4.8.6 (using /usr/bin/qmake)
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found KdepimLibs: /usr/lib/cmake/KdepimLibs/KdepimLibsConfig.cmake
CMAKE_BUILD_TYPE = Release
NO DEBUG OUTPUT
CMake Warning (dev) in src/CMakeLists.txt:
  A logical block opening on the line

    /tmp/buildd/sflphone-1.4.1/kde/src/CMakeLists.txt:215 (IF)

  closes on the line

    /tmp/buildd/sflphone-1.4.1/kde/src/CMakeLists.txt:224 (ENDIF)

  with mis-matching arguments.
This warning is for project developers. Use -Wno-dev to suppress it.

VIDEO enabled
-- Looking for dgettext
-- Looking for dgettext - found
-- Found Gettext: built in libc
CMake Error at /usr/share/kde4/apps/cmake/modules/FindGettext.cmake:232 (ADD_CUSTOM_TARGET):
  add_custom_target cannot create target "pofiles" because another target
  with the same name already exists. The existing target is a custom target
  created in source directory "/tmp/buildd/sflphone-1.4.1/kde/po/bs". See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  po/ca/CMakeLists.txt:2 (GETTEXT_PROCESS_PO_FILES)

CMake Error at /usr/share/kde4/apps/cmake/modules/FindGettext.cmake:232 (ADD_CUSTOM_TARGET):
  add_custom_target cannot create target "pofiles" because another target
  with the same name already exists. The existing target is a custom target
  created in source directory "/tmp/buildd/sflphone-1.4.1/kde/po/bs". See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  po/cs/CMakeLists.txt:2 (GETTEXT_PROCESS_PO_FILES)

CMake Error at /usr/share/kde4/apps/cmake/modules/FindGettext.cmake:232 (ADD_CUSTOM_TARGET):
  add_custom_target cannot create target "pofiles" because another target
  with the same name already exists. The existing target is a custom target
  created in source directory "/tmp/buildd/sflphone-1.4.1/kde/po/bs". See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  po/da/CMakeLists.txt:2 (GETTEXT_PROCESS_PO_FILES)

CMake Error at /usr/share/kde4/apps/cmake/modules/FindGettext.cmake:232 (ADD_CUSTOM_TARGET):
  add_custom_target cannot create target "pofiles" because another target
  with the same name already exists. The existing target is a custom target
  created in source directory "/tmp/buildd/sflphone-1.4.1/kde/po/bs". See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  po/de/CMakeLists.txt:2 (GETTEXT_PROCESS_PO_FILES)

CMake Error at /usr/share/kde4/apps/cmake/modules/FindGettext.cmake:232 (ADD_CUSTOM_TARGET):
  add_custom_target cannot create target "pofiles" because another target
  with the same name already exists. The existing target is a custom target
  created in source directory "/tmp/buildd/sflphone-1.4.1/kde/po/bs". See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  po...

Revision history for this message
Elv13 (elv1313) wrote :

Hello,

I am/was the maintainer of sflphone-kde. Sorry to hear it doesn't work anymore. If you use Ubuntu 15.04+, there is a KDE5/KF5 successor called "Ring-KDE". The support for some SIP provider is still a little buggy, but bug reports are accepted and should get fixed. My estimate is a that it work with about 60% of providers that worked with SFLphone-KDE. The UI is mostly the same (for KDE, Gnome has a new one closer to the KDE one). Here are the links to the source code:

git clone https://<email address hidden>/ring-daemon # Daemon
git clone https://<email address hidden>/ring-lrc # Shared client code by the Gnome/KDE/OSX/Windows clients
git clone http://anongit.kde.org/ring-kde # The KDE client

The vendor hosting SFLphone has closed the project and no longer accept fixes/contributions. I would fix the issues with GCC5 and the newer versions of pjprojects, but I really have nowhere to push the code to. On top of that, the Ring project is probably more future proof than the sflphone pile of dubious (but mature and field-tested) code.

Revision history for this message
Jean-Louis Dupond (dupondje) wrote :
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Sponsored and uploaded to the archive (with only a small changelog fix). Thank you for your contribution everyone!

Changed in sflphone (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sflphone - 1.4.1-0.2ubuntu2

---------------
sflphone (1.4.1-0.2ubuntu2) wily; urgency=medium

  [ Jean-Louis Dupond ]
  * Fix building on new Cmake

  [ Ryan Murray ]
  * d/patches/fixed_upstream-gcc5-auth-fix.patch: fix SIP authentication (LP:
    #1497871).
    .
    With gcc 5.x, valgrind indicates that the SIP password is pointing at
    a value on the stack in a different function. The use of the temporary
    std::string on the stack causes the cred_[i].data assignment to point to
    a stack address, that isn't be valid by the time the password is needed
    to do auth. This fixes the password pointer to be like the other auth
    strings set in this function, and fixes SIP auth.
    .
    Not forwarded upstream: already refactored in upstream ring code.

 -- Jean-Louis Dupond <email address hidden> Wed, 07 Oct 2015 11:09:44 +0200

Changed in sflphone (Ubuntu):
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.