# CVE-2025-40148: drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 16% of CVEs (2026-12-02)
- Published: 2025-11-12T10:23:26.841Z
- Modified: 2026-10-19T21:10:00.160Z
- Assigned by: Linux

## Description

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 dc_stream_set_cursor_attributes() 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/dc_stream.c:336 dc_stream_program_cursor_attributes()
error: we previously assumed 'stream' could be null (see line 334)

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

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

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

(As written by CVE List.)

## Affected

- Linux Linux: from 4465dd0e41e8223a46a41ce4fcdfc55fabd319d8 before 01e793e7d4d402c473f1a61ca5824f086693be65; from 4465dd0e41e8223a46a41ce4fcdfc55fabd319d8 before bf4e4b97d0fdc66f04fc19d807e24dd8421b8f11; 6.16 (not affected: before 6.16; from 6.17.3 up to 6.17.*; from 6.18 up to *)

## References

- <https://git.kernel.org/stable/c/01e793e7d4d402c473f1a61ca5824f086693be65>
- <https://git.kernel.org/stable/c/bf4e4b97d0fdc66f04fc19d807e24dd8421b8f11>

## Sources

- CVE List: [CVE-2025-40148](https://www.cve.org/CVERecord?id=CVE-2025-40148), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2025-40148](https://nvd.nist.gov/vuln/detail/CVE-2025-40148), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-40148 · Whole record: https://cve.day/CVE-2025-40148.json · Rebuilt by cve.day 2026-11-25T22:59:07.555Z
