CVE-2024-38621

media: stk1160: fix bounds checking in stk1160_copy_video()

HIGH
7.1
CVSS Score
Published: June 21, 2024 at 10:18 AM UTC
Updated: October 15, 2026 at 01:18 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.1
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

3.7 ≤ v < 4.19.3164.20 ≤ v < 5.4.2785.11 ≤ v < 5.15.1615.16 ≤ v < 6.1.935.5 ≤ v < 5.10.2196.2 ≤ v < 6.6.336.7 ≤ v < 6.9.43.79cb2173e6ea8f2948bd1367c93083a2500fcf08f
Vendor states this is fixed in 7532bcec0797adfa08791301c3bcae14141db3bd (fixed)
Vendor states this is fixed in a08492832cc4cacc24e0612f483c86ca899b9261 (fixed)
Vendor states this is fixed in a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7 (fixed)
Vendor states this is fixed in b504518a397059e1d55c521ba0ea2b545a6c4b52 (fixed)
Vendor states this is fixed in d410017a7181cb55e4a5c810b32b75e4416c6808 (fixed)
Vendor states this is fixed in ecf4ddc3aee8ade504c4d36b7b4053ce6093e200 (fixed)
Vendor states this is fixed in f6a392266276730bea893b55d12940e32a25f56a (fixed)
Vendor states this is fixed in faa4364bef2ec0060de381ff028d1d836600a381 (fixed)
Vendor states this is fixed in 3.7 (unaffected)
Vendor states this is fixed in 4.19.316 (unaffected)
Vendor states this is fixed in 5.10.219 (unaffected)
Vendor states this is fixed in 5.15.161 (unaffected)
Vendor states this is fixed in 5.4.278 (unaffected)
Vendor states this is fixed in 6.1.93 (unaffected)
Vendor states this is fixed in 6.10 (unaffected)
Vendor states this is fixed in 6.6.33 (unaffected)
Vendor states this is fixed in 6.9.4 (unaffected)

References (10)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/7532bcec0797adfa08791301c3bcae14141db3bd
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a08492832cc4cacc24e0612f483c86ca899b9261
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a16775828aaed1c54ff4e6fe83e8e4d5c6a50cb7
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/b504518a397059e1d55c521ba0ea2b545a6c4b52
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/d410017a7181cb55e4a5c810b32b75e4416c6808
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/ecf4ddc3aee8ade504c4d36b7b4053ce6093e200
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/f6a392266276730bea893b55d12940e32a25f56a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/faa4364bef2ec0060de381ff028d1d836600a381

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-787

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card