# CVE-2022-50077: apparmor: fix reference count leak in aa_pivotroot()

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.20%, higher than 10% of CVEs (2026-12-01)
- Published: 2025-06-18T11:02:20.318Z
- Modified: 2026-06-17T05:22:42.770Z
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

apparmor: fix reference count leak in aa_pivotroot()

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.

(As written by CVE List.)

## Affected

- Linux Linux: from 2ea3ffb7782a84da33a8382f13ebd016da50079b before d53194707d2a1851be027cd74266b96ceff799d3; from 2ea3ffb7782a84da33a8382f13ebd016da50079b before f4d5c7796571624e3f380b447ada52834270a287; from 2ea3ffb7782a84da33a8382f13ebd016da50079b before ef6fb6f0d0d8440595b45a7e53c6162c737177f4; from 2ea3ffb7782a84da33a8382f13ebd016da50079b before 2ceeb3296e9dde1d5772348046affcefdea605e2; from 2ea3ffb7782a84da33a8382f13ebd016da50079b before 64103ea357734b82384c925cba4758fdb909be0c; from 2ea3ffb7782a84da33a8382f13ebd016da50079b before 3ca40ad7afae144169a43988ef1a3f16182faf0a; from 2ea3ffb7782a84da33a8382f13ebd016da50079b before 11c3627ec6b56c1525013f336f41b79a983b4d46; 4.14 (not affected: before 4.14; from 4.14.291 up to 4.14.*; from 4.19.256 up to 4.19.*; from 5.4.211 up to 5.4.*; from 5.10.138 up to 5.10.*; from 5.15.63 up to 5.15.*; from 5.19.4 up to 5.19.*; from 6.0 up to *)
- linux linux_kernel: from 4.14.1 before 4.14.291; from 4.15 before 4.19.256; from 4.20 before 5.4.211; from 5.5 before 5.10.138; from 5.11 before 5.15.63; from 5.16 before 5.19.4; 4.14

## References

- <https://git.kernel.org/stable/c/d53194707d2a1851be027cd74266b96ceff799d3> (patch)
- <https://git.kernel.org/stable/c/f4d5c7796571624e3f380b447ada52834270a287> (patch)
- <https://git.kernel.org/stable/c/ef6fb6f0d0d8440595b45a7e53c6162c737177f4> (patch)
- <https://git.kernel.org/stable/c/2ceeb3296e9dde1d5772348046affcefdea605e2> (patch)
- <https://git.kernel.org/stable/c/64103ea357734b82384c925cba4758fdb909be0c> (patch)
- <https://git.kernel.org/stable/c/3ca40ad7afae144169a43988ef1a3f16182faf0a> (patch)
- <https://git.kernel.org/stable/c/11c3627ec6b56c1525013f336f41b79a983b4d46> (patch)

## Sources

- CVE List: [CVE-2022-50077](https://www.cve.org/CVERecord?id=CVE-2022-50077), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-50077](https://nvd.nist.gov/vuln/detail/CVE-2022-50077), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-50077 · Whole record: https://cve.day/CVE-2022-50077.json · Rebuilt by cve.day 2026-11-25T22:58:21.042Z
