CVE-2024-38621
media: stk1160: fix bounds checking in stk1160_copy_video()
Check your servers for CVE-2024-38621
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-2024-38621 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.
Description
In the Linux kernel, the following vulnerability has been resolved:
media: stk1160: fix bounds checking in stk1160_copy_video()
The subtract in this condition is reversed. The ->length is the length of the buffer. The ->bytesused is how many bytes we have copied thus far. When the condition is reversed that means the result of the subtraction is always negative but since it's unsigned then the result is a very high positive value. That means the overflow check is never true.
Additionally, the ->bytesused doesn't actually work for this purpose because we're not writing to "buf->mem + buf->bytesused". Instead, the math to calculate the destination where we are writing is a bit involved. You calculate the number of full lines already written, multiply by two, skip a line if necessary so that we start on an odd numbered line, and add the offset into the line.
To fix this buffer overflow, just take the actual destination where we are writing, if the offset is already out of bounds print an error and return. Otherwise, write up to buf->length bytes.
Exploitation
EPSS 0.28%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 21.4% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 10 Sep 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 9cb2173e6ea8f2948bd1367c93083a2500fcf08f, before f6a392266276730bea893b55d12940e32a25f56a affected from 9cb2173e6ea8f2948bd1367c93083a2500fcf08f, before ecf4ddc3aee8ade504c4d36b7b4053ce6093e200 affected from 9cb2173e6ea8f2948bd1367c93083a2500fcf08f, before a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7 affected from 9cb2173e6ea8f2948bd1367c93083a2500fcf08f, before 7532bcec0797adfa08791301c3bcae14141db3bd affected from 9cb2173e6ea8f2948bd1367c93083a2500fcf08f, before b504518a397059e1d55c521ba0ea2b545a6c4b52 affected from 9cb2173e6ea8f2948bd1367c93083a2500fcf08f, before d410017a7181cb55e4a5c810b32b75e4416c6808 affected from 9cb2173e6ea8f2948bd1367c93083a2500fcf08f, before a08492832cc4cacc24e0612f483c86ca899b9261 affected from 9cb2173e6ea8f2948bd1367c93083a2500fcf08f, before faa4364bef2ec0060de381ff028d1d836600a381
Other versions: unaffected
|
| Linux |
affected 3.7 unaffected before 3.7 unaffected from 4.19.316 up to and including 4.19.* unaffected from 5.4.278 up to and including 5.4.* unaffected from 5.10.219 up to and including 5.10.* unaffected from 5.15.161 up to and including 5.15.* unaffected from 6.1.93 up to and including 6.1.* unaffected from 6.6.33 up to and including 6.6.* unaffected from 6.9.4 up to and including 6.9.* unaffected 6.10 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-2024-38621 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-38621
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-2024-38621
trivy image --scanners vuln IMAGE | grep CVE-2024-38621
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
- https://git.kernel.org/stable/c/f6a392266276730bea893b55d12940e32a25f56a git.kernel.org
- https://git.kernel.org/stable/c/ecf4ddc3aee8ade504c4d36b7b4053ce6093e200 git.kernel.org
- https://git.kernel.org/stable/c/a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7 git.kernel.org
- https://git.kernel.org/stable/c/7532bcec0797adfa08791301c3bcae14141db3bd git.kernel.org
- https://git.kernel.org/stable/c/b504518a397059e1d55c521ba0ea2b545a6c4b52 git.kernel.org
- https://git.kernel.org/stable/c/d410017a7181cb55e4a5c810b32b75e4416c6808 git.kernel.org
- https://git.kernel.org/stable/c/a08492832cc4cacc24e0612f483c86ca899b9261 git.kernel.org
- https://git.kernel.org/stable/c/faa4364bef2ec0060de381ff028d1d836600a381 git.kernel.org
- https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html lists.debian.org
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html cert-portal.siemens.com
Source: the record CVE-2024-38621 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse