apparmor: remove explicit restriction that unconfined cannot use change_hat
authorJohn Johansen <john.johansen@canonical.com>
Fri, 19 Jan 2024 08:24:03 +0000 (00:24 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 18 Jan 2025 14:47:12 +0000 (06:47 -0800)
commit35fad5b462224e0da3764f68b69827281eeaac8c
tree68707d95adeff0ffc576adaa1c5558ffb9f0042a
parentcd769b05cc87fb527dbab547e65b934b45705d6b
apparmor: remove explicit restriction that unconfined cannot use change_hat

There does not need to be an explicit restriction that unconfined
can't use change_hat. Traditionally unconfined doesn't have hats
so change_hat could not be used. But newer unconfined profiles have
the potential of having hats, and even system unconfined will be
able to be replaced with a profile that allows for hats.

To remain backwards compitible with expected return codes, continue
to return -EPERM if the unconfined profile does not have any hats.

Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/apparmorfs.c
security/apparmor/domain.c