{"id":"CVE-2025-40148","aliases":["CVE-2025-40148"],"related":[],"kind":"vulnerability","state":"published","title":"drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions\n\nThe function dc_stream_set_cursor_attributes() currently dereferences\nthe `stream` pointer and nested members `stream->ctx->dc->current_state`\nwithout checking for NULL.\n\nAll callers of these functions, such as in\n`dcn30_apply_idle_power_optimizations()` and\n`amdgpu_dm_plane_handle_cursor_update()`, already perform NULL checks\nbefore calling these functions.\n\nFixes below:\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:336 dc_stream_program_cursor_attributes()\nerror: we previously assumed 'stream' could be null (see line 334)\n\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c\n    327 bool dc_stream_program_cursor_attributes(\n    328         struct dc_stream_state *stream,\n    329         const struct dc_cursor_attributes *attributes)\n    330 {\n    331         struct dc  *dc;\n    332         bool reset_idle_optimizations = false;\n    333\n    334         dc = stream ? stream->ctx->dc : NULL;\n                     ^^^^^^\nThe old code assumed stream could be NULL.\n\n    335\n--> 336         if (dc_stream_set_cursor_attributes(stream, attributes)) {\n                                                    ^^^^^^\nThe refactor added an unchecked dereference.\n\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c\n   313  bool dc_stream_set_cursor_attributes(\n   314          struct dc_stream_state *stream,\n   315          const struct dc_cursor_attributes *attributes)\n   316  {\n   317          bool result = false;\n   318\n   319          if (dc_stream_check_cursor_attributes(stream, stream->ctx->dc->current_state, attributes)) {\n                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here.\nThis function used to check for if stream as NULL and return false at\nthe start. Probably we should add that back.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions\n\nThe function dc_stream_set_cursor_attributes() currently dereferences\nthe `stream` pointer and nested members `stream->ctx->dc->current_state`\nwithout checking for NULL.\n\nAll callers of these functions, such as in\n`dcn30_apply_idle_power_optimizations()` and\n`amdgpu_dm_plane_handle_cursor_update()`, already perform NULL checks\nbefore calling these functions.\n\nFixes below:\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:336 dc_stream_program_cursor_attributes()\nerror: we previously assumed 'stream' could be null (see line 334)\n\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c\n    327 bool dc_stream_program_cursor_attributes(\n    328         struct dc_stream_state *stream,\n    329         const struct dc_cursor_attributes *attributes)\n    330 {\n    331         struct dc  *dc;\n    332         bool reset_idle_optimizations = false;\n    333\n    334         dc = stream ? stream->ctx->dc : NULL;\n                     ^^^^^^\nThe old code assumed stream could be NULL.\n\n    335\n--> 336         if (dc_stream_set_cursor_attributes(stream, attributes)) {\n                                                    ^^^^^^\nThe refactor added an unchecked dereference.\n\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c\n   313  bool dc_stream_set_cursor_attributes(\n   314          struct dc_stream_state *stream,\n   315          const struct dc_cursor_attributes *attributes)\n   316  {\n   317          bool result = false;\n   318\n   319          if (dc_stream_check_cursor_attributes(stream, stream->ctx->dc->current_state, attributes)) {\n                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here.\nThis function used to check for if stream as NULL and return false at\nthe start. Probably we should add that back.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ndrm/amd/display: Añadir comprobaciones de puntero NULL en las funciones de atributo de cursor dc_stream\n\nLa función dc_stream_set_cursor_attributes() actualmente desreferencia el puntero 'stream' y los miembros anidados 'stream->ctx->dc->current_state' sin comprobar si es NULL.\n\nTodos los llamadores de estas funciones, como en 'dcn30_apply_idle_power_optimizations()' y 'amdgpu_dm_plane_handle_cursor_update()', ya realizan comprobaciones de NULL antes de llamar a estas funciones.\n\nCorrecciones a continuación:\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:336 dc_stream_program_cursor_attributes()\nerror: anteriormente asumimos que 'stream' podría ser nulo (ver línea 334)\n\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c\n    327 bool dc_stream_program_cursor_attributes(\n    328         struct dc_stream_state *stream,\n    329         const struct dc_cursor_attributes *attributes)\n    330 {\n    331         struct dc  *dc;\n    332         bool reset_idle_optimizations = false;\n    333\n    334         dc = stream ? stream->ctx->dc : NULL;\n                     ^^^^^^\nEl código antiguo asumía que stream podría ser NULL.\n\n    335\n--> 336         if (dc_stream_set_cursor_attributes(stream, attributes)) {\n                                                    ^^^^^^\nLa refactorización añadió una desreferencia sin comprobar.\n\ndrivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c\n   313  bool dc_stream_set_cursor_attributes(\n   314          struct dc_stream_state *stream,\n   315          const struct dc_cursor_attributes *attributes)\n   316  {\n   317          bool result = false;\n   318\n   319          if (dc_stream_check_cursor_attributes(stream, stream->ctx->dc->current_state, attributes)) {\n                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Aquí.\nEsta función solía comprobar si stream era NULL y devolver false al principio. Probablemente deberíamos volver a añadir eso.","source":"nvd"}],"published":"2025-11-12T10:23:26.841Z","modified":"2026-10-19T21:10:00.160Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"4465dd0e41e8223a46a41ce4fcdfc55fabd319d8","fixed":"01e793e7d4d402c473f1a61ca5824f086693be65","status":"affected"},{"type":"git","introduced":"4465dd0e41e8223a46a41ce4fcdfc55fabd319d8","fixed":"bf4e4b97d0fdc66f04fc19d807e24dd8421b8f11","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.16","status":"unaffected"},{"type":"semver","introduced":"6.17.3","lastAffected":"6.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.18","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/01e793e7d4d402c473f1a61ca5824f086693be65","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bf4e4b97d0fdc66f04fc19d807e24dd8421b8f11","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40148","url":"https://www.cve.org/CVERecord?id=CVE-2025-40148","licence":"CVE Terms of Use","modified":"2026-05-11T21:43:39.984Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40148","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40148","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:07.555Z","epss":{"score":0.00241,"percentile":0.16356,"date":"2026-12-02T12:00:21.000Z"}}