bind mounts related to content interface plugs remain stale on snap disconnect/connect or snap updates

Bug #1646333 reported by Alberto Aguirre on 2016-12-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Undecided
Unassigned

Bug Description

To reproduce:

snap install --edge test-snapd-content-slot
snap install --edge test-snapd-content-plug
snap disconnect test-snapd-content-plug:shared-content-plug
test-snapd-content-plug.content-plug

"
Please run:
sudo snap connect content-plug:shared-content-plug content-slot:shared-content-slot
if you see an permission denied error
cat: /snap/test-snapd-content-plug/2/import/shared-content: No such file or directory
"

This is fine so far, as the plug is disconnected, but now try connecting the plug

snap connect test-snapd-content-plug:shared-content-plug test-snapd-content-slot:shared-content-slot

albaguirre@localhost:~$ test-snapd-content-plug.content-plug
Please run:
sudo snap connect content-plug:shared-content-plug content-slot:shared-content-slot
if you see an permission denied error
cat: /snap/test-snapd-content-plug/2/import/shared-content: No such file or directory

The same issue occurs when a snap updates to a new revision and the content plug is auto-connected. The bind mount will be stale and point to the old destination directory.

Alberto Aguirre (albaguirre) wrote :

It looks like snap-confine has no way of checking that the fstab mnt entries generated by the snapd mount security backend have been changed or removed.

Probably easier to have snapd call snap-discard-ns on any content i/f connects/disconnects.

Zygmunt Krynicki (zyga) wrote :

This is now a part of snapd master and available in the core snap in the edge channel. Interface changes (connection/disconnection) are now propagated to existing namespaces.

Changed in snappy:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers