Skip to content
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

data/selinux: update the policy to allow s-c to manipulate BPF map and programs #10802

Merged
merged 2 commits into from Sep 20, 2021

Conversation

bboozzoo
Copy link
Collaborator

Update the SELinux policy. The bpffs is mounted at /sys/fs/bpf, so we need permissions to list/read /sys. On top of this, there's separate permissions to manipulate files in bpffs, and bpf related capabilities.

…d programs

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
@bboozzoo bboozzoo added the Simple 😃 A small PR which can be reviewed quickly label Sep 17, 2021
Copy link
Contributor

@stolowski stolowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! Suggested one typo fix.

@@ -577,6 +577,15 @@ allow snappy_confine_t snappy_snap_t:process transition;

allow snappy_confine_t self:process { setexec };
allow snappy_confine_t self:capability { setgid setuid sys_admin sys_chroot dac_read_search dac_override };
# when managing cgroup v2 snap-confines creates BPF map and attaches a BPF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# when managing cgroup v2 snap-confines creates BPF map and attaches a BPF
# when managing cgroup v2 snap-confine creates BPF map and attaches a BPF

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2021

Codecov Report

Merging #10802 (4258876) into master (6efac1b) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10802   +/-   ##
=======================================
  Coverage   78.33%   78.33%           
=======================================
  Files         890      890           
  Lines      100198   100231   +33     
=======================================
+ Hits        78486    78519   +33     
  Misses      16793    16793           
  Partials     4919     4919           
Flag Coverage Δ
unittests 78.33% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
asserts/snapasserts/validation_sets.go 97.24% <0.00%> (-1.82%) ⬇️
overlord/snapstate/storehelpers.go 78.41% <0.00%> (-0.82%) ⬇️
overlord/snapstate/snapstate.go 81.15% <0.00%> (+0.13%) ⬆️
overlord/ifacestate/handlers.go 64.92% <0.00%> (+0.14%) ⬆️
overlord/ifacestate/helpers.go 77.52% <0.00%> (+0.49%) ⬆️
overlord/hookstate/hookmgr.go 74.83% <0.00%> (+0.66%) ⬆️
cmd/snap/main.go 67.24% <0.00%> (+1.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6efac1b...4258876. Read the comment docs.

Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Copy link
Contributor

@mardy mardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand very little of selinux, but LGTM :-D

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
@mvo5 mvo5 merged commit 32a6b5b into snapcore:master Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple 😃 A small PR which can be reviewed quickly
Projects
None yet
5 participants