Commit 59da628a authored by Jann Horn's avatar Jann Horn Committed by Shrirang Bagul
Browse files

apparmor: don't try to replace stale label in ptraceme check

BugLink: https://bugs.launchpad.net/bugs/1887715



[ Upstream commit ca3fde52 ]

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: b2d09ae4 ("apparmor: move ptrace checks to using labels")
Reported-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Reported-by: default avatarkernel test robot <rong.a.chen@intel.com>
Signed-off-by: default avatarJann Horn <jannh@google.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
(cherry picked from commit c9cb63e400e1584d80ccf297bfb96e2c50448a5e)
Signed-off-by: default avatarShrirang Bagul <shrirang.bagul@canonical.com>
parent bbf6d03f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment