Jelajahi Sumber

disp: msm: hdcp: avoid sink message processing when hdcp is off

Skip processing the sink message in sde_hdcp_2x_main thread when hdcp
TA is unloaded. If there is any error generated during the
authentication sequence, then the hdcp authentication is aborted and
the source will restart the authentication procedure. When
authentication is aborted, the qseecom handle is lost and memory it
referenced becomes protected. When a subsequent command execution in
the sde_hdcp_2x_main thread tries to dereference that particular
memory from the qseecom handle, there is a page fault crash observed.

This change will skip accessing the memory referenced by the qseecom
handle when hdcp authentication session is tearing down.

Change-Id: I71ed44042897f17cc8817a1b1c54a43e42cf5f73
Signed-off-by: Sankeerth Billakanti <[email protected]>
Sankeerth Billakanti 5 tahun lalu
induk
melakukan
a8972ccc53
1 mengubah file dengan 8 tambahan dan 0 penghapusan
  1. 8 0
      msm/sde_hdcp_2x.c

+ 8 - 0
msm/sde_hdcp_2x.c

@@ -480,6 +480,12 @@ static void sde_hdcp_2x_msg_sent(struct sde_hdcp_2x_ctrl *hdcp)
 
 	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_ENTRY, hdcp->authenticated,
 					hdcp->app_data.response.data[0]);
+
+	if (atomic_read(&hdcp->hdcp_off)) {
+		pr_debug("invalid state, hdcp off\n");
+		goto exit;
+	}
+
 	switch (hdcp->app_data.response.data[0]) {
 	case SKE_SEND_TYPE_ID:
 		if (!hdcp2_app_comm(hdcp->hdcp2_ctx,
@@ -531,6 +537,8 @@ static void sde_hdcp_2x_msg_sent(struct sde_hdcp_2x_ctrl *hdcp)
 	}
 
 	sde_hdcp_2x_wakeup_client(hdcp, &cdata);
+
+exit:
 	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, hdcp->authenticated);
 }