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)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:04:13 +0000 (14:04 +0200)
commita078d77fb083a364341b376c8cfec25c00f50ee2
tree17fa31dc304dcf40d93e9d610b06aa8c081a0729
parent1259d17c102f9a5b3a063d32c567b6bbeb0fa285
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