CVE-2024-38621
kernel: media: stk1160: fix bounds checking in stk1160_copy_video()
Overview
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.
Source: OX vulnerability database
Severity
7.1 · HIGH
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
Weakness: CWE-787
Affected packages · 0
No registry package. This ID affects operating system packages only.
Operating systems · 132 fixes
Oracle Linux 2 releases · 3 packages
| Release | Package | Fixed in |
|---|---|---|
| 7 | kernel-uek-headers +1 | 4.14.35-2047.540.4.1.el7uek |
| 7 | kernel-uek-container +1 | 5.4.17-2136.334.6.el7 |
| 7 | kernel-uek +8 | 5.4.17-2136.334.6.el7uek |
| 8 | kernel-uek-container +1 | 5.4.17-2136.334.6.el8 |
| 8 | kernel-uek +4 | 5.4.17-2136.334.6.el8uek |
Photon OS 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | bpftool +9 | 5.10.219-1.ph4 |
| 5.0 | bpftool +10 | 6.1.94-1.ph5 |
SUSE Linux Enterprise 3 releases · 12 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 12.5 | kgraft-patch-4-12-14-122-222-default | 1-8.3.1 | SUSE-SU-2024:2561-1 |
| 12.5 | cluster-md-kmp-rt +11 | 4.12.14-10.191.1 | SUSE-SU-2024:2381-1 |
| 12.5 | cluster-md-kmp-default +16 | 4.12.14-122.222.1 | SUSE-SU-2024:2561-1 |
| 12.5 | kernel-azure +5 | 4.12.14-16.191.1 | SUSE-SU-2024:2360-1 |
| 15.5 | kernel-livepatch-5-14-21-150500-13-61-rt | 1-150500.11.3.1 | SUSE-SU-2024:2394-1 |
| 15.5 | kernel-livepatch-5-14-21-150500-55-73-default | 1-150500.11.3.1 | SUSE-SU-2024:2939-1 |
11 more rows
SUSE Linux Enterprise Micro 2 releases · 4 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 5.5 | kernel-rt +1 | 5.14.21-150500.13.61.1 | SUSE-SU-2024:2394-1 |
| 5.5 | kernel-default | 5.14.21-150500.55.73.1 | SUSE-SU-2024:2939-1 |
| 5.5 | kernel-default-base | 5.14.21-150500.55.73.1.150500.6.33.8 | SUSE-SU-2024:2939-1 |
| 6.0 | kernel-default-base | 6.4.0-17.1.1.51 | SUSE-SU-2025:20008-1 |
| 6.0 | kernel-default +5 | 6.4.0-18.1 | SUSE-SU-2025:20008-1 |
| 6.0 | kernel-devel-rt +2 | 6.4.0-9.1 | SUSE-SU-2025:20028-1 |
debian 5 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 10 | linux | 4.19.316-1 |
| 11 | linux | 5.10.221-1 |
| 12 | linux | 6.1.94-1 |
| 13 | linux | 6.9.7-1 |
| 14 | linux | 6.9.7-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| linux | 6.1.94-1 |
openSUSE Leap Micro 1 release · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 5.5 | kernel-default | 5.14.21-150500.55.73.1 | SUSE-SU-2024:2939-1 |
| 5.5 | kernel-default-base | 5.14.21-150500.55.73.1.150500.6.33.8 | SUSE-SU-2024:2939-1 |
root.io debian 3 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 11 | rootio-linux | 5.10.221-1 |
| 12 | rootio-linux | 6.1.94-1 |
| 13 | rootio-linux | 6.9.7-1 |
root.io ubuntu 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 22.04 | rootio-linux | 5.15.0-121.131 |
| 24.04 | rootio-linux | 6.8.0-44.44 |
ubuntu 5 releases · 47 packages
| Release | Package | Fixed in |
|---|---|---|
| 18.04-ESM | linux-oracle | 4.15.0-1136.147 |
| 18.04-ESM | linux-kvm | 4.15.0-1157.162 |
| 18.04-ESM | linux-gcp-4-15 | 4.15.0-1167.184 |
| 18.04-ESM | linux-aws | 4.15.0-1174.187 |
| 18.04-ESM | linux-azure-4-15 | 4.15.0-1182.197 |
| 18.04-ESM | linux | 4.15.0-230.242 |
83 more rows
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2024-38621
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/html/ssa-398330.html
- git.kernel.org https://git.kernel.org/linus/faa4364bef2ec0060de381ff028d1d836600a381 (6.10-rc1)
- git.kernel.org https://git.kernel.org/stable/c/7532bcec0797adfa08791301c3bcae14141db3bd
- git.kernel.org https://git.kernel.org/stable/c/a08492832cc4cacc24e0612f483c86ca899b9261
- git.kernel.org https://git.kernel.org/stable/c/a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7
- 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/ecf4ddc3aee8ade504c4d36b7b4053ce6093e200
- git.kernel.org https://git.kernel.org/stable/c/f6a392266276730bea893b55d12940e32a25f56a
Show all 39 references
- git.kernel.org https://git.kernel.org/stable/c/faa4364bef2ec0060de381ff028d1d836600a381
- linux.oracle.com https://linux.oracle.com/cve/CVE-2024-38621.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2024-12611.html
- lists.debian.org https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html
- lore.kernel.org https://lore.kernel.org/linux-cve-announce/2024062138-CVE-2024-38621-d52e@gregkh/T
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2024-38621
- ubuntu.com https://ubuntu.com/security/notices/USN-6951-1
- ubuntu.com https://ubuntu.com/security/notices/USN-6951-2
- ubuntu.com https://ubuntu.com/security/notices/USN-6951-3
- ubuntu.com https://ubuntu.com/security/notices/USN-6951-4
- ubuntu.com https://ubuntu.com/security/notices/USN-6953-1
- ubuntu.com https://ubuntu.com/security/notices/USN-6979-1
- ubuntu.com https://ubuntu.com/security/notices/USN-6999-1
- ubuntu.com https://ubuntu.com/security/notices/USN-6999-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7004-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7005-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7005-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7007-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7007-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7007-3
- ubuntu.com https://ubuntu.com/security/notices/USN-7008-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7009-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7009-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7019-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7029-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7069-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7069-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7110-1
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2024-38621
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.