~snappy-dev/snapd/+git/snapd-pawel:bad-interfaces-warn

Last commit made on 2019-11-25
Get this branch:
git clone -b bad-interfaces-warn https://git.launchpad.net/~snappy-dev/snapd/+git/snapd-pawel

Branch merges

Branch information

Name:
bad-interfaces-warn
Repository:
lp:~snappy-dev/snapd/+git/snapd-pawel

Recent commits

7c7279a... by Paweł Stołowski

Tweak bad interfaces test.

a8d7ef1... by Paweł Stołowski

Merge branch 'master' into bad-interfaces-warn

3e097ec... by Samuele Pedroni

Merge pull request #7777 from jdstrand/lp1850552

snap-confine: suppress noisy classic snap file_inherit denials

Classic snaps that use the chromium content api create a lot of log spam
due to bug #1849753. Eg:

audit[3275]: AVC apparmor="DENIED" operation="file_inherit"
profile="/snap/core/7917/usr/lib/snapd/snap-confine" pid=3275
comm="snap-confine" family="unix" sock_type="stream" protocol=0
requested_mask="send receive" denied_mask="send receive" addr=none
peer_addr=none
audit[3275]: AVC apparmor="DENIED" operation="file_inherit"
profile="/snap/core/7917/usr/lib/snapd/snap-confine"
name="/dev/shm/.org.chromium.Chromium.6xtos6" pid=3275
comm="snap-confine" requested_mask="wr" denied_mask="wr" fsuid=1000
ouid=1000

On a system with vscode and slack, there are thousands of these per day:

$ grep file_inherit ./audit.log |
grep -E '(family="unix" .* addr=none peer_addr=none|
/dev/shm/.org.chromium.Chromium)'|wc -l
101912

As a temporary stop-gap, explicitly deny the noisiest denials until
bug #1849753 is fixed.

There is no chance of regression for this since snap-confine is already
denying them. We could consider making these allowed rather than
explicit deny, but people haven't been complaining about these classic
chromium content api snaps not working, so I'd like to continue denying
for now.

References:

https://launchpad.net/bugs/1850552
https://launchpad.net/bugs/1849753

e7b5169... by Maciej Borzecki

Merge pull request #7770 from bboozzoo/bboozzoo/mock-command-abs-path

testutil, many: make MockCommand() create prefix of absolute paths

Followup on #7755. We have some code that mocks commands at absolute paths. Normally this would require the caller to create the prefix manually. The patches extend MockCommand() to create prefix.

a65178e... by Paweł Stołowski

Merge pull request #7727 from stolowski/improve-prereq-test

tests: improve TestDoPrereqRetryWhenBaseInFlight to fix occasional flakiness.

The test could fail very sporadically (e.g. after 2 hours when run in a loop) with the prerequsites task in "Done" state instead of expected "Doing". It's relatively easy to make this test fail fast (e.g. after just a few iterations when run in a loop by modifying the wait times inside the test loop, e.g. from 1 ms to 1s).

This was caused by delicate time dependencies in the test. The main task status-probing loop probably assumed that every Ensure+Wait execution picked exactly one task at a time, but what I found by a bit of printf-debugging in the test and in the taskrunner code was that every iteration executed both tasks - most likely because there is no blocking (as WaitFor) dependency between the tasks; that meant that on the second iteration of the loop, if link-snap was picked first (meaning it finished the job that prereq waits for), then prerequsites would also run and transition to DoneStatus too, and therefore the expectation that Ensure loop ends with link-snap in DoneStatus and prerequisites in DoingStatus would not hold true.

The fix here moves the check for prerequisites being in "DoingStatus" into the fake link-snap handler. It also cleans the test a little bit and reduces all wait-times to the minimum as they are not ciritcial anymore to drive the test.

74bc3bd... by Samuele Pedroni

Merge pull request #7774 from pedronis/seed-20-optional-snaps-support

seed: proper support for optional snaps for Core 20 models

Optional model snaps get included if they are specified explicitly via SetOptionsSnaps, that means --snap to prepare-image/ubuntu-image.

To enable this this had to relax the checks around invoking SetOptionsSnaps vs dangerous. The allowed features are now using the later checks, that were already in place, but the corresponding test had to be modified.

e7afbc3... by Jamie Strandboge

snap-confine: suppress noisy classic snap file_inherit denials

Classic snaps that use the chromium content api create a lot of log spam
due to bug #1849753. Eg:

audit[3275]: AVC apparmor="DENIED" operation="file_inherit"
profile="/snap/core/7917/usr/lib/snapd/snap-confine" pid=3275
comm="snap-confine" family="unix" sock_type="stream" protocol=0
requested_mask="send receive" denied_mask="send receive" addr=none
peer_addr=none
audit[3275]: AVC apparmor="DENIED" operation="file_inherit"
profile="/snap/core/7917/usr/lib/snapd/snap-confine"
name="/dev/shm/.org.chromium.Chromium.6xtos6" pid=3275
comm="snap-confine" requested_mask="wr" denied_mask="wr" fsuid=1000
ouid=1000

On a system with vscode and slack, there are thousands of these per day:

$ grep file_inherit ./audit.log |\
  grep -E '(family="unix" .* addr=none peer_addr=none|\
            /dev/shm/\.org\.chromium\.Chromium)'|wc -l
101912

As a temporary stop-gap, explicitly deny the noisiest denials until
bug #1849753 is fixed.

There is no chance of regression for this since snap-confine is already
denying them. We could consider making these allowed rather than
explicit deny, but people haven't been complaining about these classic
chromium content api snaps not working, so I'd like to continue denying
for now.

References:
- https://launchpad.net/bugs/1850552
- https://launchpad.net/bugs/1849753

e4c8b5b... by Samuele Pedroni

seed: proper support for optional snaps for Core 20 models

c092655... by Samuele Pedroni

Merge pull request #7764 from pedronis/core20-snapd-overriding-fix

many: test various kinds of overriding for the snapd snap in Core 20

This also fixes issues related to support listing it explicitly in the model, in that regard is a follow up to #7720.

9d3bd78... by Maciej Borzecki

cmd/snap-failure: update tests to use MockCommand

Update the code from master branch to use the testutil.MockCommand() rather than
the internal helper that got removed.

Signed-off-by: Maciej Borzecki <email address hidden>