{"id":"CVE-2022-50855","state":"PUBLISHED","title":"bpf: prevent leak of lsm program after failed attach","description":"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/","publishedAt":"2025-12-30T12:15:30.481Z","updatedAt":"2026-05-11T19:26:25.459Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"69fd337a975c7e690dfe49d9cb4fe5ba1e6db44e","status":"affected","lessThan":"82b39df5ddb298daaf6dc504032ff7eb027fa106","versionType":"git"},{"version":"69fd337a975c7e690dfe49d9cb4fe5ba1e6db44e","status":"affected","lessThan":"6a1504dd36cd9a0a69250d61da8bdb17b29f1fe8","versionType":"git"},{"version":"69fd337a975c7e690dfe49d9cb4fe5ba1e6db44e","status":"affected","lessThan":"e89f3edffb860a0f54a9ed16deadb7a4a1fa3862","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/syscall.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.0","versionType":"semver"},{"version":"6.0.16","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.2","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/syscall.c"]}],"references":["https://git.kernel.org/stable/c/82b39df5ddb298daaf6dc504032ff7eb027fa106","https://git.kernel.org/stable/c/6a1504dd36cd9a0a69250d61da8bdb17b29f1fe8","https://git.kernel.org/stable/c/e89f3edffb860a0f54a9ed16deadb7a4a1fa3862"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50855.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50855","state":"PUBLISHED","datePublished":"2025-12-30T12:15:30.481Z","dateUpdated":"2026-05-11T19:26:25.459Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-12-30T12:06:07.135Z"},"containers":{"cna":{"title":"bpf: prevent leak of lsm program after failed attach","descriptions":[{"lang":"en","value":"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/"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"69fd337a975c7e690dfe49d9cb4fe5ba1e6db44e","status":"affected","lessThan":"82b39df5ddb298daaf6dc504032ff7eb027fa106","versionType":"git"},{"version":"69fd337a975c7e690dfe49d9cb4fe5ba1e6db44e","status":"affected","lessThan":"6a1504dd36cd9a0a69250d61da8bdb17b29f1fe8","versionType":"git"},{"version":"69fd337a975c7e690dfe49d9cb4fe5ba1e6db44e","status":"affected","lessThan":"e89f3edffb860a0f54a9ed16deadb7a4a1fa3862","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/syscall.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.0","versionType":"semver"},{"version":"6.0.16","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.2","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/syscall.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/82b39df5ddb298daaf6dc504032ff7eb027fa106"},{"url":"https://git.kernel.org/stable/c/6a1504dd36cd9a0a69250d61da8bdb17b29f1fe8"},{"url":"https://git.kernel.org/stable/c/e89f3edffb860a0f54a9ed16deadb7a4a1fa3862"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:26:25.459Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.0.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.1.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.0","versionEndExcluding":"6.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}