From: Khalid Elmously Date: Tue, 25 Feb 2020 23:20:03 +0000 (-0500) Subject: Revert "apparmor: don't try to replace stale label in ptrace access check" X-Git-Tag: Ubuntu-4.15.0-92.93~438 X-Git-Url: https://git.proxmox.com/?p=mirror_ubuntu-bionic-kernel.git;a=commitdiff_plain;h=fe59c080a30977b5651784bf4a57cf1baa5c0ea4 Revert "apparmor: don't try to replace stale label in ptrace access check" BugLink: https://bugs.launchpad.net/bugs/1864063 This reverts commit 5b9276f0312a8866928088fa05d170e551b5cd3e. Signed-off-by: Khalid Elmously --- diff --git a/security/apparmor/include/context.h b/security/apparmor/include/context.h index 4031bf0d67fa..349ea3088267 100644 --- a/security/apparmor/include/context.h +++ b/security/apparmor/include/context.h @@ -210,8 +210,6 @@ static inline struct aa_label *begin_current_label_crit_section(void) { struct aa_label *label = aa_current_raw_label(); - might_sleep(); - if (label_is_stale(label)) { label = aa_get_newest_label(label); if (aa_replace_current_label(label) == 0) diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 384da7789d94..80da8e51c2fe 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -87,12 +87,12 @@ static int apparmor_ptrace_access_check(struct task_struct *child, struct aa_label *tracer, *tracee; int error; - tracer = __begin_current_label_crit_section(); + tracer = begin_current_label_crit_section(); tracee = aa_get_task_label(child); error = aa_may_ptrace(tracer, tracee, mode == PTRACE_MODE_READ ? AA_PTRACE_READ : AA_PTRACE_TRACE); aa_put_label(tracee); - __end_current_label_crit_section(tracer); + end_current_label_crit_section(tracer); return error; }