Skip to content

Commit

Permalink
AppArmor: Allow signals receiving (#13998)
Browse files Browse the repository at this point in the history
This is a workaround for AppArmor 4.0+ and new
unconfined profile feature. It was found [1]
that the new unconfined profile mode is not fully
permissive. Some things are forbidden for no reason.

We need this change to prevent breakage of LXD
when we eventually enable a new unconfined mode for lxd-support plug in
snapd.

This change is absolutely safe in general and there is no reason to put
it under "if" condition. [2]

[1] https://bugs.launchpad.net/apparmor/+bug/2077413
[2] https://gitlab.com/apparmor/apparmor/-/merge_requests/1310
[3] https://bugs.launchpad.net/apparmor/+bug/2067900/comments/2
  • Loading branch information
tomponline authored Aug 28, 2024
2 parents 6d6aad0 + af91f3f commit d1e2752
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lxd/apparmor/instance_forkproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ var forkproxyProfileTpl = template.Must(template.New("forkproxyProfile").Parse(`
profile "{{ .name }}" flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
# Allow processes to send us signals by default
signal (receive),
# Capabilities
capability chown,
capability dac_read_search,
Expand Down
3 changes: 3 additions & 0 deletions lxd/apparmor/instance_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ profile "{{ .name }}" flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/consoles>
#include <abstractions/nameservice>
# Allow processes to send us signals by default
signal (receive),
capability dac_override,
capability dac_read_search,
capability ipc_lock,
Expand Down
3 changes: 3 additions & 0 deletions lxd/apparmor/network_dnsmasq.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ profile "{{ .name }}" flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/dbus>
#include <abstractions/nameservice>
# Allow processes to send us signals by default
signal (receive),
# Capabilities
capability chown,
capability net_bind_service,
Expand Down
3 changes: 3 additions & 0 deletions lxd/apparmor/network_forkdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ var forkdnsProfileTpl = template.Must(template.New("forkdnsProfile").Parse(`#inc
profile "{{ .name }}" flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
# Allow processes to send us signals by default
signal (receive),
# Network access
network inet dgram,
network inet6 dgram,
Expand Down
3 changes: 3 additions & 0 deletions lxd/apparmor/pyuefivars.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ var pythonUEFIVarsProfileTpl = template.Must(template.New("pythonUEFIVarsProfile
profile "{{ .name }}" flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
# Allow processes to send us signals by default
signal (receive),
# Python locations
/usr/bin/python* mixr,
/bin**/*.py r,
Expand Down
3 changes: 3 additions & 0 deletions lxd/apparmor/qemuimg.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ var qemuImgProfileTpl = template.Must(template.New("qemuImgProfile").Parse(`#inc
profile "{{ .name }}" flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
# Allow processes to send us signals by default
signal (receive),
capability dac_override,
capability dac_read_search,
capability ipc_lock,
Expand Down
3 changes: 3 additions & 0 deletions lxd/apparmor/rsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ var rsyncProfileTpl = template.Must(template.New("rsyncProfile").Parse(`#include
profile "{{ .name }}" flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
# Allow processes to send us signals by default
signal (receive),
capability chown,
capability dac_override,
capability dac_read_search,
Expand Down

0 comments on commit d1e2752

Please sign in to comment.