diff options
author | Benjamin Gaignard <benjamin.gaignard@st.com> | 2020-02-03 13:16:20 +0100 |
---|---|---|
committer | Benjamin Gaignard <benjamin.gaignard@st.com> | 2020-02-28 13:08:00 +0100 |
commit | d6b8bbca6bc83b9c57e528b28df6177b9b57e19d (patch) | |
tree | 59f3563521cf06c264d5036a5d50bb6b77edbbe3 /drivers/gpu/drm | |
parent | cb897542c6d2b34c7203b1a2e030ff35e100eef8 (diff) | |
download | linux-d6b8bbca6bc83b9c57e528b28df6177b9b57e19d.tar.bz2 |
drm/dp_mst: Check crc4 value while building sideband message
Check that computed crc value is matching the one encoded in the message.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200203121620.9002-1-benjamin.gaignard@st.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_dp_mst_topology.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index ba15a15bce9e..61e7beada832 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -736,6 +736,10 @@ static bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg, if (msg->curchunk_idx >= msg->curchunk_len) { /* do CRC */ crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len - 1); + if (crc4 != msg->chunk[msg->curchunk_len - 1]) + print_hex_dump(KERN_DEBUG, "wrong crc", + DUMP_PREFIX_NONE, 16, 1, + msg->chunk, msg->curchunk_len, false); /* copy chunk into bigger msg */ memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len - 1); msg->curlen += msg->curchunk_len - 1; |