CVE-2022-50840

scsi: snic: Fix possible UAF in snic_tgt_create()

No CVSS score yet EPSS 0.30%

Published 30 Dec 2025 Updated 11 May 2026 CNA: Linux

Check your servers for CVE-2022-50840

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-50840 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

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

scsi: snic: Fix possible UAF in snic_tgt_create()

Smatch reports a warning as follows:

drivers/scsi/snic/snic_disc.c:307 snic_tgt_create() warn: '&tgt->list' not removed from list

If device_add() fails in snic_tgt_create(), tgt will be freed, but tgt->list will not be removed from snic->disc.tgt_list, then list traversal may cause UAF.

Remove from snic->disc.tgt_list before free().

Exploitation

EPSS 0.30%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 25.0% of all scored CVEs. Scores of 1 Dec 2026.

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before f9d8b8ba0f1a16cde0b1fc9e80466df76b6db8ff
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before 3772319e40527e6a5f2ec1d729e01f271d818f5c
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before 3007f96ca20c848d0b1b052df6d2cb5ae5586e78
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before 6866154c23fba40888ad6d554cccd4bf2edb755e
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before ad27f74e901fc48729733c88818e6b96c813057d
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before 1895e908b3ae66a5312fd1b2cdda2da82993dca7
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before c7f0f8dab1ae5def57c1a8a9cafd6fabe1dc27cc
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before 4141cd9e8b3379aea52a85d2c35f6eaf26d14e86
affected from c8806b6c9e824f47726f2a9b7fbbe7ebf19306fa, before e118df492320176af94deec000ae034cc92be754
Other versions: unaffected
Linux
affected 4.2
unaffected before 4.2
unaffected from 4.9.337 up to and including 4.9.*
unaffected from 4.14.303 up to and including 4.14.*
unaffected from 4.19.270 up to and including 4.19.*
unaffected from 5.4.229 up to and including 5.4.*
unaffected from 5.10.163 up to and including 5.10.*
unaffected from 5.15.86 up to and including 5.15.*
unaffected from 6.0.16 up to and including 6.0.*
unaffected from 6.1.2 up to and including 6.1.*
unaffected 6.2 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2022-50840 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2022-50840

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2022-50840
trivy image --scanners vuln IMAGE | grep CVE-2022-50840

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2022-50840 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.