mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-15 19:55:32 +00:00
apparmor: fix reference count leak in aa_pivotroot()
commit11c3627ec6
upstream. The aa_pivotroot() function has a reference counting bug in a specific path. When aa_replace_current_label() returns on success, the function forgets to decrement the reference count of “target”, which is increased earlier by build_pivotroot(), causing a reference leak. Fix it by decreasing the refcount of “target” in that path. Fixes:2ea3ffb778
("apparmor: add mount mediation") Co-developed-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Co-developed-by: Xin Tan <tanxin.ctf@gmail.com> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn> Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3c1d209120
commit
e70778fa09
1 changed files with 1 additions and 0 deletions
|
@ -719,6 +719,7 @@ int aa_pivotroot(struct aa_label *label, const struct path *old_path,
|
|||
aa_put_label(target);
|
||||
goto out;
|
||||
}
|
||||
aa_put_label(target);
|
||||
} else
|
||||
/* already audited error */
|
||||
error = PTR_ERR(target);
|
||||
|
|
Loading…
Add table
Reference in a new issue