From: Lyude Paul <lyude@redhat.com>
To: Benjamin Gaignard <benjamin.gaignard@st.com>,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@linux.ie, daniel@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
jani.nikula@linux.intel.com
Subject: Re: [PATCH] drm/dp_mst: Check crc4 value while building sideband message
Date: Tue, 04 Feb 2020 14:00:09 -0500 [thread overview]
Message-ID: <75b302aa739511b3cc2abf4360d5780a08e7c17a.camel@redhat.com> (raw)
In-Reply-To: <20200203121620.9002-1-benjamin.gaignard@st.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
On Mon, 2020-02-03 at 13:16 +0100, Benjamin Gaignard wrote:
> Check that computed crc value is matching the one encoded in the message.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
> CC: lyude@redhat.com
> CC: airlied@linux.ie
> CC: jani.nikula@linux.intel.com
> drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 822d2f177f90..eee899d6742b 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;
--
Cheers,
Lyude Paul
next prev parent reply other threads:[~2020-02-04 19:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 12:16 Benjamin Gaignard
2020-02-04 19:00 ` Lyude Paul [this message]
2020-02-28 12:16 ` Benjamin Gaignard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75b302aa739511b3cc2abf4360d5780a08e7c17a.camel@redhat.com \
--to=lyude@redhat.com \
--cc=airlied@linux.ie \
--cc=benjamin.gaignard@st.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®