Skip to content

Commit 5fe89a6

Browse files
committed
drm: Fix HDCP failures when SRM fw is missing
The SRM cleanup in 79643fd ("drm/hdcp: optimizing the srm handling") inadvertently altered the behavior of HDCP auth when the SRM firmware is missing. Before that patch, missing SRM was interpreted as the device having no revoked keys. With that patch, if the SRM fw file is missing we reject _all_ keys. This patch fixes that regression by returning success if the file cannot be found. It also checks the return value from request_srm such that we won't end up trying to parse the ksv list if there is an error fetching it. Fixes: 79643fd ("drm/hdcp: optimizing the srm handling") Cc: [email protected] Cc: Ramalingam C <[email protected]> Cc: Sean Paul <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Reviewed-by: Ramalingam C <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Changes in v2: -Noticed a couple other things to clean up Reviewed-by: Ramalingam C <[email protected]>
1 parent 3a3a71f commit 5fe89a6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/gpu/drm/drm_hdcp.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev,
241241

242242
ret = request_firmware_direct(&fw, (const char *)fw_name,
243243
drm_dev->dev);
244-
if (ret < 0)
244+
if (ret < 0) {
245+
*revoked_ksv_cnt = 0;
246+
*revoked_ksv_list = NULL;
247+
ret = 0;
245248
goto exit;
249+
}
246250

247251
if (fw->size && fw->data)
248252
ret = drm_hdcp_srm_update(fw->data, fw->size, revoked_ksv_list,
@@ -287,6 +291,8 @@ int drm_hdcp_check_ksvs_revoked(struct drm_device *drm_dev, u8 *ksvs,
287291

288292
ret = drm_hdcp_request_srm(drm_dev, &revoked_ksv_list,
289293
&revoked_ksv_cnt);
294+
if (ret)
295+
return ret;
290296

291297
/* revoked_ksv_cnt will be zero when above function failed */
292298
for (i = 0; i < revoked_ksv_cnt; i++)

0 commit comments

Comments
 (0)