apparmor policy forbids using /tmp
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Snappy |
Medium
|
Michael Vogt | ||
| | apparmor-easyprof-ubuntu-snappy (Ubuntu) |
High
|
Jamie Strandboge | ||
| | click-bin-path (Ubuntu) |
High
|
Michael Vogt | ||
Bug Description
A lot Ubuntu packages as well as many non-ubuntu upstream prjects assume that they can access /tmp/. This currently fails:
mktemp: failed to create file via template ‘/tmp/setup.
[ 3664.391441] audit: type=1400 audit(141804540
Related branches
| Martin Pitt (pitti) wrote : | #1 |
| Martin Pitt (pitti) wrote : | #2 |
Turns out ROS isn't respecting $TMPDIR (nor $TEMPDIR), so that wouldn't even help. I think a more robust alternative would be to mount a private /tmp into an app's mout namespace?
| Michael Vogt (mvo) wrote : | #3 |
This will be part of the new ubuntu-
| Alexander Sack (asac) wrote : | #4 |
clearly a problem for our sourceries story; marking as devel and security XP; however, I beleive we should give apps their own confinded tmp space; lets check our FHS story and see what is missing or if there is just magic making apps find the right place...
| Changed in snappy-ubuntu: | |
| importance: | Undecided → High |
| status: | New → Confirmed |
| tags: | added: snappy-xp-devel snappy-xp-security |
| description: | updated |
| information type: | Embargoed → Public |
| information type: | Public → Private |
| Changed in snappy-ubuntu: | |
| assignee: | nobody → Jamie Strandboge (jdstrand) |
| Jamie Strandboge (jdstrand) wrote : | #5 |
Allowing access to /tmp/** breaks application isolation which is why we don't allow it now. We agreed in Cape Town that the temp dir handling will be done by the launcher.
In the short term, that should be done by having the current launcher script set TMPDIR and make sure it exists. When the actual launcher is in place, the plan is to setup an overlayfs on /tmp, however the viability of using overlayfs in this capacity is still in question (investigations are still happening as of today), so an alternative may need to be put in place.
If neither of the above is feasible for ROS in the shortest of terms, we can *temporarily* relax our policy until we have the full story in place.
| Martin Pitt (pitti) wrote : | #6 |
Unfortunately $TMPDIR nor $TEMPDIR don't work for ROS. The README.md has a workaround how to locally allow this in the apparmor policy.
| Alexander Sack (asac) wrote : | #7 |
We should extend our FHS spec to include a TMP dir tjhat we set properly?
we can either add a SNAPP_TMPDIR and then apps can make their own wrapper or we just set TMPDIR directly also for those that honour that practice.
I would suggest that if noone else thinks different we just do /tmp/snapps/
| Alexander Sack (asac) wrote : | #8 |
I would say what I say is in line with current spirit. later overlayfs will sovlve these things, but for now, lets do that. jdstrand/mvo, who needs to do what task?
| Alexander Sack (asac) wrote : | #9 |
ok lets spec it in the way above:
+ [mvo] add app tmp dir to FHS spec: /tmp/snapps/
+ [mvo] snappy will create that dir if not exist
+ [jdstrand] apparmor default policy will allow the binaries access to their own tmp dir
+ [mvo] snappy will set SNAPP_TMPDIR, TMPDIR and TEMPDIR to that directory for max convenience.
| Alexander Sack (asac) wrote : | #10 |
also:
+ [pitti] to fix stuff so it honours that.
| Changed in apparmor-easyprof-ubuntu-snappy (Ubuntu): | |
| status: | New → In Progress |
| importance: | Undecided → High |
| assignee: | nobody → Jamie Strandboge (jdstrand) |
| Changed in snappy-ubuntu: | |
| assignee: | Jamie Strandboge (jdstrand) → nobody |
| Changed in click-bin-path (Ubuntu): | |
| importance: | Undecided → High |
| assignee: | nobody → Michael Vogt (mvo) |
| Changed in snappy-ubuntu: | |
| assignee: | nobody → Michael Vogt (mvo) |
| Launchpad Janitor (janitor) wrote : | #11 |
This bug was fixed in the package apparmor-
---------------
apparmor-
* ubuntu-
temp dir (/tmp/snapps/
-- Jamie Strandboge <email address hidden> Thu, 15 Jan 2015 15:49:14 -0600
| Changed in apparmor-easyprof-ubuntu-snappy (Ubuntu): | |
| status: | In Progress → Fix Released |
| Changed in click-bin-path (Ubuntu): | |
| status: | New → Fix Released |
| Martin Pitt (pitti) wrote : | #12 |
> + [pitti] to fix stuff so it honours that.
Wrt. the ROS tutorial: I filed the problem and solution upstream: https:/
I applied the fix in the snap build script: https:/
| Changed in snappy-ubuntu: | |
| importance: | High → Medium |
| Changed in snappy-ubuntu: | |
| status: | Confirmed → Fix Released |
| affects: | snappy-ubuntu → snappy |
| information type: | Private → Public |


Alternatively, the generated snappy-bin/ wrapper needs to uncomment the TMPDIR and make sure that the directory actually exists.