{"id":"CVE-2022-50855","summary":"bpf: prevent leak of lsm program after failed attach","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: prevent leak of lsm program after failed attach\n\nIn [0], we added the ability to bpf_prog_attach LSM programs to cgroups,\nbut in our validation to make sure the prog is meant to be attached to\nBPF_LSM_CGROUP, we return too early if the check fails. This results in\nlack of decrementing prog's refcnt (through bpf_prog_put)\nleaving the LSM program alive past the point of the expected lifecycle.\nThis fix allows for the decrement to take place.\n\n[0] https://lore.kernel.org/all/20220628174314.1216643-4-sdf@google.com/","modified":"2026-04-02T08:28:48.331132Z","published":"2025-12-30T12:15:30.481Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50855.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/6a1504dd36cd9a0a69250d61da8bdb17b29f1fe8"},{"type":"WEB","url":"https://git.kernel.org/stable/c/82b39df5ddb298daaf6dc504032ff7eb027fa106"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e89f3edffb860a0f54a9ed16deadb7a4a1fa3862"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50855.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50855"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"69fd337a975c7e690dfe49d9cb4fe5ba1e6db44e"},{"fixed":"82b39df5ddb298daaf6dc504032ff7eb027fa106"},{"fixed":"6a1504dd36cd9a0a69250d61da8bdb17b29f1fe8"},{"fixed":"e89f3edffb860a0f54a9ed16deadb7a4a1fa3862"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50855.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.0.0"},{"fixed":"6.0.16"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.1.0"},{"fixed":"6.1.2"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50855.json"}}],"schema_version":"1.7.5"}