Commit 3f61185
committed
drm/dp_mst: Fix down request message timeout handling
If receiving a reply for an MST down request message times out, the
thread receiving the reply in drm_dp_mst_handle_down_rep() could try to
dereference the drm_dp_sideband_msg_tx txmsg request message after the
thread waiting for the reply - calling drm_dp_mst_wait_tx_reply() - has
timed out and freed txmsg, hence leading to a use-after-free in
drm_dp_mst_handle_down_rep().
Prevent the above by holding the drm_dp_mst_topology_mgr::qlock in
drm_dp_mst_handle_down_rep() for the whole duration txmsg is looked up
from the request list and dereferenced.
v2: Fix unlocking mgr->qlock after verify_rx_request_type() fails.
Cc: Lyude Paul <lyude@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241203174632.2941402-1-imre.deak@intel.com1 parent b559b68 commit 3f61185
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3984 | 3984 | | |
3985 | 3985 | | |
3986 | 3986 | | |
| 3987 | + | |
3987 | 3988 | | |
3988 | 3989 | | |
3989 | | - | |
3990 | 3990 | | |
3991 | 3991 | | |
3992 | 3992 | | |
| |||
3995 | 3995 | | |
3996 | 3996 | | |
3997 | 3997 | | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
3998 | 4001 | | |
3999 | 4002 | | |
4000 | 4003 | | |
4001 | | - | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
4002 | 4007 | | |
| 4008 | + | |
4003 | 4009 | | |
4004 | 4010 | | |
4005 | 4011 | | |
| |||
4013 | 4019 | | |
4014 | 4020 | | |
4015 | 4021 | | |
4016 | | - | |
4017 | 4022 | | |
4018 | 4023 | | |
| 4024 | + | |
4019 | 4025 | | |
4020 | 4026 | | |
4021 | 4027 | | |
| |||
0 commit comments