]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: don't try to replace stale label in ptraceme check
authorJann Horn <jannh@google.com>
Sat, 29 Sep 2018 01:49:26 +0000 (03:49 +0200)
committerJohn Johansen <john.johansen@canonical.com>
Wed, 3 Oct 2018 13:29:22 +0000 (06:29 -0700)
commit7962c0201268f6ab1ba61b6add7d237a86bef91f
tree74d474a553b59e9b0bcc1bf5627047f9bf3023f2
parent928b2fe09516118ecb9dafcccccdd267cb3a26a6
apparmor: don't try to replace stale label in ptraceme check

begin_current_label_crit_section() must run in sleepable context because
when label_is_stale() is true, aa_replace_current_label() runs, which uses
prepare_creds(), which can sleep.

Until now, the ptraceme access check (which runs with tasklist_lock held)
violated this rule.

Fixes: bbeb3ef201543 ("apparmor: move ptrace checks to using labels")
Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/lsm.c