/etc/ld.so.conf.d/conjure-up.conf breaks apt on host system

Bug #1677417 reported by Steve Langasek
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
snapd
Invalid
Undecided
Unassigned
conjure-up (Ubuntu)
Fix Released
Critical
Adam Stokes

Bug Description

update-manager failed to run today on my system. When I investigated, I found this:

$ sudo apt -f install
apt: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0: symbol
_ZN13pkgSourceList16AddVolatileFilesER11CommandLinePSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EE, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference
$ ldd -d -r /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0 2>&1 | grep libapt-pkg
        libapt-pkg.so.5.0 => /snap/conjure-up/156/usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0 (0x00007f5da24bf000)
$ cat /etc/ld.so.conf.d/conjure-up.conf
/snap/conjure-up/156/usr/lib/x86_64-linux-gnu/
$

The conjure-up snap is bundling a copy of libapt-pkg from xenial, which is incompatible with the libapt-private from yakkety.

I see several things wrong with this.

 - conjure-up should not be monkeying with the library path of the host system. It appears to have been doing this for some time already before this current version of the snap; it's only the latest version that has added libapt-pkg to the snap and broken things in a way that I noticed, but it was already broken before this for conjure-up to tamper *at all* with the system path.
 - this is not the only change that conjure-up makes to the host system from its configure hook. It also creates a file /usr/lib/sysctl.d/60-conjure-up.conf, and manually installs files under /usr/share/bash-completion/completions; and I have no idea what other things it might have done in previous versions of the snap. The system integration goals here are reasonable, but the way conjure-up goes about them are unauditable.
 - thirdly, and the reason I'm filing this against snappy: I understand classic snaps being unconfined, by definition. But why does this translate to a classic snap having the power to run an unconfined hook? This is ten times worse than a dpkg maintainer script. For maintainer scripts we have policy around what the script may or may not touch on the filesystem, we have a community process governing who is allowed to upload packages to the Ubuntu archive; for classic snaps we are lacking both of these safeguards. My expectation was that a classic snap would modify the host filesystem only under the user's direction. An unconfined configure hook is a whole other matter entirely.

Steve Langasek (vorlon)
Changed in snappy:
importance: Undecided → Critical
Changed in conjure-up (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Adam Stokes (adam-stokes)
Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1677417] [NEW] /etc/ld.so.conf.d/conjure-up.conf breaks apt on host system

The confinement of the config hook is a really good idea; we don't want
a general mechanism to deliver bash to a system, we want a general
mechanism to deliver binaries to a system, and the configuration of
those binaries can reasonably be expected to be confined.

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

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

Changed in conjure-up (Ubuntu):
status: New → Confirmed
Revision history for this message
Ivy Alexander (ivyalexander) wrote :

Installing the conjure-up snap on a fresh install of Yakkety will render apt unusable.

ubuntu@ubuntu:~$ sudo snap install conjure-up --classic
conjure-up 2.1.2 from 'canonical' installed
ubuntu@ubuntu:~$ sudo apt upgrade
apt: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0: symbol _ZN13pkgSourceList16AddVolatileFilesER11CommandLinePSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EE, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

Revision history for this message
Zygmunt Krynicki (zyga) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Also, removing the snap leaves the ld.so.conf file there:

andreas@nsn7:~$ snap remove conjure-up
conjure-up removed

andreas@nsn7:~$ cat /etc/ld.so.conf.d/conjure-up.conf
/snap/conjure-up/140/usr/lib/x86_64-linux-gnu/

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

The bug is really in the snap. It shouldn't be doing that.

I've provided a longer rationale and a fix proposal there, where we have more eyes watching.

I would like to close this bug as "Invalid".

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Sorry, by "there" I mean in the forum Zyga mentioned above.

Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote :

hi,
any work around ? since its broke the apt so the system can't be upgraded

Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote :

I've removed the conjure-up snap to make the apt working again.

Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote :

then reinstall latest conjure-up snap rev. 162 seem not braking the apt

Revision history for this message
Gaétan QUENTIN (gaetan-quentin) wrote :

To correct it temporaly:
comment out the content:
/etc/ld.so.conf.d/conjure-up.conf
 -> #/snap/conjure-up/156/usr/lib/x86_64-linux-gnu/

and call ldconfig.

apt will work again

Changed in conjure-up (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm marking the snapd bug as invalid as the ability to run unconfined (for good or worse) is a fundamental property of snapd and the issue is with a particular snap, not the packaging system.

affects: snappy → snapd
Changed in snapd:
status: New → Invalid
importance: Critical → Undecided
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.