summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorXiyu Yang <xiyuyang19@fudan.edu.cn>2020-04-05 13:11:55 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-27 17:46:41 +0200
commit054934aa9faa480276e360588c7286a9490c2a2e (patch)
treec0c8a7bf42fcc07446e1bf6265dc173d7a963bdb /tools
parent97d817b9ef13e2d52a86ea032b0df6a922e0e9df (diff)
downloadlinux-stable-054934aa9faa480276e360588c7286a9490c2a2e.tar.gz
linux-stable-054934aa9faa480276e360588c7286a9490c2a2e.tar.bz2
linux-stable-054934aa9faa480276e360588c7286a9490c2a2e.zip
apparmor: fix potential label refcnt leak in aa_change_profile
commit a0b845ffa0d91855532b50fc040aeb2d8338dca4 upstream. aa_change_profile() invokes aa_get_current_label(), which returns a reference of the current task's label. According to the comment of aa_get_current_label(), the returned reference must be put with aa_put_label(). However, when the original object pointed by "label" becomes unreachable because aa_change_profile() returns or a new object is assigned to "label", reference count increased by aa_get_current_label() is not decreased, causing a refcnt leak. Fix this by calling aa_put_label() before aa_change_profile() return and dropping unnecessary aa_get_current_label(). Fixes: 9fcf78cca198 ("apparmor: update domain transitions that are subsets of confinement at nnp") Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions