diff options
author | Jann Horn <jannh@google.com> | 2018-09-13 18:12:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 14:49:55 +0100 |
commit | e58f543fc7c0926f31a49619c1a3648e49e8d233 (patch) | |
tree | 80b02aa3263ead1bff7ac9c41b2557f089c56c1d /security/apparmor/include/secid.h | |
parent | c4629743ed2ba592741825622b62dd1ca867ee0f (diff) | |
download | linux-rt-e58f543fc7c0926f31a49619c1a3648e49e8d233.tar.gz |
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: b2d09ae449ced ("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>
Diffstat (limited to 'security/apparmor/include/secid.h')
0 files changed, 0 insertions, 0 deletions