-
Notifications
You must be signed in to change notification settings - Fork 737
Fix the snap qemu native mount regression #3871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm this makes both native mounts and bridging work properly. Just curious about something inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright 👍
dc71170 to
f87ce6b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3871 +/- ##
=======================================
Coverage 89.02% 89.02%
=======================================
Files 255 255
Lines 14577 14577
=======================================
Hits 12977 12977
Misses 1600 1600 ☔ View full report in Codecov by Sentry. |
Fix the snap qemu native mount regression
Fix the snap qemu native mount regression
Fix the snap qemu native mount regression
Fix the snap qemu native mount regression
Fix #3834
Possible explanation on the behavior we saw.
%4/bin/bridge_helperwithout any permissions. The behavior for this case is the bridging feature can run with the permissions it needs and the mount folder lost its write permission somehow. The reason behind this is thatbridge_helperoperates in the unrestricted mode when no permissions are specified, meaning that it inherits all permissions and capabilities from the parent process. That is why the bridging feature is able to run. When AppArmor is in unrestricted mode (%4/bin/bridge_helperwithout explicit permissions), the mode may interfere with the rule order in the profile. More specifically, it can result in mounted folder permissions which is defined later in this profile being overridden or deprioritized. That is why the write permission issue occurs.%4/bin/bridge_helper ixis used, AppArmor applies strict enforcement on the executable. In this case, it does not seem to disrupt the mount folder permissions setting, so the mount folder feature works properly. On the other side, since it is strict mode, we need to specify everything it requires to make the bridging works. That includesThe key take away from this is always use explicit permissions (strict mode) on newly added binaries and find the minimal setup (permissions and capabilities) to make it work.
The functional testing should cover the bridging feature (
multipass launch -n vm2 --network=mpqemubr0) and the linux qemu native mount.