kernel-fxtec-pro1x/security/apparmor
Jann Horn e58f543fc7 apparmor: don't try to replace stale label in ptrace access check
[ Upstream commit 1f8266ff58840d698a1e96d2274189de1bdf7969 ]

As a comment above begin_current_label_crit_section() explains,
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 ptrace access check (which runs with a task lock held)
violated this rule.

Also add a might_sleep() assertion to begin_current_label_crit_section(),
because asserts are less likely to be ignored than comments.

Fixes: b2d09ae449 ("apparmor: move ptrace checks to using labels")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:49:55 +01:00
..
include apparmor: don't try to replace stale label in ptrace access check 2020-01-27 14:49:55 +01:00
.gitignore
apparmorfs.c apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock 2020-01-09 10:19:02 +01:00
audit.c
capability.c LSM: generalize flag passing to security_capable 2020-01-23 08:21:29 +01:00
crypto.c
domain.c apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock 2020-01-09 10:19:02 +01:00
file.c
ipc.c LSM: generalize flag passing to security_capable 2020-01-23 08:21:29 +01:00
Kconfig
label.c apparmor: fix unsigned len comparison with less than zero 2020-01-04 19:13:08 +01:00
lib.c
lsm.c apparmor: don't try to replace stale label in ptrace access check 2020-01-27 14:49:55 +01:00
Makefile
match.c
mount.c
net.c apparmor: Fix network performance issue in aa_label_sk_perm 2020-01-27 14:49:54 +01:00
nulldfa.in
path.c
policy.c apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock 2020-01-09 10:19:02 +01:00
policy_ns.c
policy_unpack.c
procattr.c
resource.c LSM: generalize flag passing to security_capable 2020-01-23 08:21:29 +01:00
secid.c
stacksplitdfa.in
task.c