CVE-2025-40148

Source
https://cve.org/CVERecord?id=CVE-2025-40148
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40148.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-40148
Downstream
Published
2025-11-12T10:23:26.841Z
Modified
2025-12-05T10:20:26.641258Z
Summary
drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions
Details

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

drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions

The function dcstreamsetcursorattributes() currently dereferences the stream pointer and nested members stream->ctx->dc->current_state without checking for NULL.

All callers of these functions, such as in dcn30_apply_idle_power_optimizations() and amdgpu_dm_plane_handle_cursor_update(), already perform NULL checks before calling these functions.

Fixes below: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dcstream.c:336 dcstreamprogramcursor_attributes() error: we previously assumed 'stream' could be null (see line 334)

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dcstream.c 327 bool dcstreamprogramcursorattributes( 328 struct dcstreamstate *stream, 329 const struct dccursorattributes *attributes) 330 { 331 struct dc *dc; 332 bool resetidle_optimizations = false; 333 334 dc = stream ? stream->ctx->dc : NULL; ^^^^^^ The old code assumed stream could be NULL.

335

--> 336 if (dcstreamsetcursorattributes(stream, attributes)) { ^^^^^^ The refactor added an unchecked dereference.

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dcstream.c 313 bool dcstreamsetcursorattributes( 314 struct dcstreamstate *stream, 315 const struct dccursorattributes *attributes) 316 { 317 bool result = false; 318 319 if (dcstreamcheckcursorattributes(stream, stream->ctx->dc->currentstate, attributes)) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here. This function used to check for if stream as NULL and return false at the start. Probably we should add that back.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40148.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4465dd0e41e8223a46a41ce4fcdfc55fabd319d8
Fixed
01e793e7d4d402c473f1a61ca5824f086693be65
Fixed
bf4e4b97d0fdc66f04fc19d807e24dd8421b8f11

Affected versions

v6.*
v6.14
v6.14-rc7
v6.15
v6.15-rc1
v6.15-rc2
v6.15-rc3
v6.15-rc4
v6.15-rc5
v6.15-rc6
v6.15-rc7
v6.16
v6.16-rc1
v6.16-rc2
v6.16-rc3
v6.16-rc4
v6.16-rc5
v6.16-rc6
v6.16-rc7
v6.17
v6.17-rc1
v6.17-rc2
v6.17-rc3
v6.17-rc4
v6.17-rc5
v6.17-rc6
v6.17-rc7
v6.17.1
v6.17.2

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40148.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.16.0
Fixed
6.17.3

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40148.json"