interfaces/apparmor/template.go: adjust /dev/shm to be more usable #1135

Merged
merged 2 commits into from May 19, 2016

Conversation

Projects
None yet
4 participants
Contributor

jdstrand commented May 5, 2016

Allow snap-specific access to files and directories in /dev/shm. The previous
implementation of /dev/shm/snap/SNAP_NAME/SNAP_REVISION was problematic
because it didn't handle shm_open() at all and was uncomfortable for developers
to use with open(). This allows file access in /dev/shm for shm_open() and
files in subdirectories for open().

interfaces/apparmor/template.go: adjust /dev/shm to be more usable
Allow snap-specific access to files and directories in /dev/shm. The previous
implementation of /dev/shm/snap/SNAP_NAME/SNAP_REVISION was problematic
because it didn't handle shm_open() at all and was uncomfortable for developers
to use with open(). This allows file access in /dev/shm for shm_open() and
files in subdirectories for open().
Contributor

zyga commented May 5, 2016

+1, thanks :-)

Contributor

niemeyer commented May 5, 2016

Let's please hold this until we discuss next week.

Collaborator

mvo5 commented May 10, 2016

I close tihs for now based on the comment from gustavo. Please reopen once this was discussed.

@mvo5 mvo5 closed this May 10, 2016

Contributor

jdstrand commented May 17, 2016

Reopening since last week went by. This is not intended to address https://bugs.launchpad.net/snappy/+bug/1577514 which I agree does require more discussion-- did that happen?

This PR stands separate from the bug though and it isn't clear to me why this was closed; this update provides essentially equivalent access as before except it fixes shm_open() and more flexible snap-specific accesses are allowed. Ie, snaps may now use shm_open() if they specify snap..* (which prior to this PR a snap could not use shm_open() at all) and also allows snaps to create snap-specific files and directories in /dev/shm. Neither of these opens up the policy in overlapping snap specific ways.

@jdstrand jdstrand reopened this May 17, 2016

Contributor

niemeyer commented May 19, 2016

retest this please

Contributor

niemeyer commented May 19, 2016

We discussed this last week, and the agreement was two-fold:

  • We'll white list /dev/shm/snap.$SNAP_NAME.* for private use by the snap
  • We'll white list /dev/shm/<prefix>-* via interfaces on clear cases (e.g. pulseaudio)

So this branch is good to move forward

@niemeyer niemeyer merged commit 9678fd4 into snapcore:master May 19, 2016

3 of 4 checks passed

autopkgtest
Details
Integration tests Success
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 79.526%
Details

@jdstrand jdstrand deleted the jdstrand:shm-updates branch May 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment