CVE-2025-40148
Gravedad:
Pendiente de análisis
Tipo:
No Disponible / Otro tipo
Fecha de publicación:
12/11/2025
Última modificación:
12/11/2025
Descripción
*** Pendiente de traducción *** In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions<br />
<br />
The function dc_stream_set_cursor_attributes() currently dereferences<br />
the `stream` pointer and nested members `stream->ctx->dc->current_state`<br />
without checking for NULL.<br />
<br />
All callers of these functions, such as in<br />
`dcn30_apply_idle_power_optimizations()` and<br />
`amdgpu_dm_plane_handle_cursor_update()`, already perform NULL checks<br />
before calling these functions.<br />
<br />
Fixes below:<br />
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:336 dc_stream_program_cursor_attributes()<br />
error: we previously assumed &#39;stream&#39; could be null (see line 334)<br />
<br />
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c<br />
327 bool dc_stream_program_cursor_attributes(<br />
328 struct dc_stream_state *stream,<br />
329 const struct dc_cursor_attributes *attributes)<br />
330 {<br />
331 struct dc *dc;<br />
332 bool reset_idle_optimizations = false;<br />
333<br />
334 dc = stream ? stream->ctx->dc : NULL;<br />
^^^^^^<br />
The old code assumed stream could be NULL.<br />
<br />
335<br />
--> 336 if (dc_stream_set_cursor_attributes(stream, attributes)) {<br />
^^^^^^<br />
The refactor added an unchecked dereference.<br />
<br />
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c<br />
313 bool dc_stream_set_cursor_attributes(<br />
314 struct dc_stream_state *stream,<br />
315 const struct dc_cursor_attributes *attributes)<br />
316 {<br />
317 bool result = false;<br />
318<br />
319 if (dc_stream_check_cursor_attributes(stream, stream->ctx->dc->current_state, attributes)) {<br />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here.<br />
This function used to check for if stream as NULL and return false at<br />
the start. Probably we should add that back.



