apparmor: fix module parameters can be changed after policy is locked
authorJohn Johansen <john.johansen@canonical.com>
Thu, 23 Jun 2016 01:01:08 +0000 (18:01 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:17:17 +0000 (13:17 +0000)
commit89b1324ceba6294ed514de8d4bdd46bf1880960c
tree171f0d75356f0a41c89f479ec26331e0a9a09f11
parent083a92fa4c5ac527198d6a17c720b4d6524768c9
apparmor: fix module parameters can be changed after policy is locked

commit 58acf9d911c8831156634a44d0b022d683e1e50c upstream.

the policy_lock parameter is a one way switch that prevents policy
from being further modified. Unfortunately some of the module parameters
can effectively modify policy by turning off enforcement.

split policy_admin_capable into a view check and a full admin check,
and update the admin check to test the policy_lock parameter.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
security/apparmor/include/policy.h
security/apparmor/lsm.c
security/apparmor/policy.c