drm: Fix HDCP failures when SRM fw is missing
Subsystems (3)
PATCH 1/1 drm: Fix HDCP failures when SRM fw is missing
From: Sean Paul <[email protected]>
The SRM cleanup in 79643fddd6eb2 ("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.
--- drivers/gpu/drm/drm_hdcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_hdcp.c +3 -1
@@ -241,8 +241,10 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev, ret =request_firmware_direct (&fw, (const char *)fw_name, drm_dev->dev); -if (ret <0 ) +if (ret <0 ) { + ret =0 ; goto exit; + }if (fw->size && fw->data) ret = drm_hdcp_srm_update(fw->data, fw->size, revoked_ksv_list,
Signature · 6 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm: Fix HDCP failures when SRM fw is missing
From: Sean Paul <[email protected]>
The SRM cleanup in 79643fddd6eb2 ("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.
Changes in v2:
-Noticed a couple other things to clean up
---
Sorry for the quick rev, noticed a couple other loose ends that should be cleaned up.
drivers/gpu/drm/drm_hdcp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_hdcp.c +7 -1
@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev, ret =request_firmware_direct (&fw, (const char *)fw_name, drm_dev->dev); -if (ret <0 ) +if (ret <0 ) { + *revoked_ksv_cnt =0 ; + *revoked_ksv_list =NULL ; + ret =0 ; goto exit; + }if (fw->size && fw->data) 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, ret =drm_hdcp_request_srm (drm_dev, &revoked_ksv_list, &revoked_ksv_cnt); +if (ret) +return ret;/* revoked_ksv_cnt will be zero when above function failed */ for (i =0 ; i < revoked_ksv_cnt; i++)
Signature · 6 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 40 lines · Sean Paul
From: Sean Paul <[email protected]>
The SRM cleanup in
79643fddd6eb2("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_srmsuch that we won't end up trying to parse the ksv list if there is an error fetching it.Fixes 79643fddd6eb ("drm/hdcp: optimizing the srm handling")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]>Signed-off-by Sean Paul <[email protected]>Changes in v2:
-Noticed a couple other things to clean up
---Sorry for the quick rev, noticed a couple other loose ends that should be cleaned up.
drivers/gpu/drm/drm_hdcp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_hdcp.c +0
-0
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 246
Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c +3
-1@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev, ret =request_firmware_direct (&fw, (const char *)fw_name, drm_dev->dev); -if (ret <0 ) +if (ret <0 ) { + *revoked_ksv_cnt =0 ; + *revoked_ksv_list =NULL ;
These two variables are already initialized by the caller.
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 247
Quoted 1 line
drivers/gpu/drm/drm_hdcp.c +1
-0+ ret =0 ;
Missing of this should have been caught by CI. May be CI system always having the SRM file from previous execution. Never been removed. IGT need a fix to clean the prior SRM files before execution.
CI fix shouldn't block this fix.
drivers/gpu/drm/drm_hdcp.c int drm_hdcp_check_ksvs_revoked(struct drm_device *drm_dev, u8 *ksvs, · line 295
Quoted 11 lines
drivers/gpu/drm/drm_hdcp.c +3
-0goto exit; + }if (fw->size && fw->data) 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, ret =drm_hdcp_request_srm (drm_dev, &revoked_ksv_list, &revoked_ksv_cnt); +if (ret) +return ret;
This error code also shouldn't effect the caller(i915) hence pushed a change https://patchwork.freedesktop.org/series/76730/
With these addresed.
LGTM.
Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +0
-1/* revoked_ksv_cnt will be zero when above function failed */ for (i =0 ; i < revoked_ksv_cnt; i++) --Sean Paul, Software Engineer, Google / Chromium OS
Quoted 43 lines · Ramalingam C
Quoted 41 lines · Sean Paul
From: Sean Paul <[email protected]>
The SRM cleanup in
79643fddd6eb2("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_srmsuch that we won't end up trying to parse the ksv list if there is an error fetching it.Fixes 79643fddd6eb ("drm/hdcp: optimizing the srm handling")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]>Signed-off-by Sean Paul <[email protected]>Changes in v2:
-Noticed a couple other things to clean up
---Sorry for the quick rev, noticed a couple other loose ends that should be cleaned up.
drivers/gpu/drm/drm_hdcp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_hdcp.c +0
-0@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev,
Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 246
Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +3
-1ret =request_firmware_direct (&fw, (const char *)fw_name, drm_dev->dev); -if (ret <0 ) +if (ret <0 ) { + *revoked_ksv_cnt =0 ; + *revoked_ksv_list =NULL ;These two variables are already initialized by the caller.
Right now it is, but that's not guaranteed. In the ret == 0 case, it's pretty common for a caller to assume the called function has validated/assigned all the function output.
Quoted 13 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 247
Quoted 1 line
drivers/gpu/drm/drm_hdcp.c +1
-0+ ret =0 ;Missing of this should have been caught by CI. May be CI system always having the SRM file from previous execution. Never been removed. IGT need a fix to clean the prior SRM files before execution.
CI fix shouldn't block this fix.
Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c +1
-0goto exit; + }if (fw->size && fw->data) 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,
Quoted 5 lines
drivers/gpu/drm/drm_hdcp.c int drm_hdcp_check_ksvs_revoked(struct drm_device *drm_dev, u8 *ksvs, · line 295
Quoted 4 lines
drivers/gpu/drm/drm_hdcp.c +2
-0ret =drm_hdcp_request_srm (drm_dev, &revoked_ksv_list, &revoked_ksv_cnt); +if (ret) +return ret;This error code also shouldn't effect the caller(i915)
Why not? I'd assume an invalid SRM revocation list should probably be treated as failure?
Quoted 14 lines
hence pushed a
change https://patchwork.freedesktop.org/series/76730/With these addresed.
LGTM.
Reviewed-by Ramalingam C <[email protected]>Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +0
-1/* revoked_ksv_cnt will be zero when above function failed */ for (i =0 ; i < revoked_ksv_cnt; i++) --Sean Paul, Software Engineer, Google / Chromium OS
Quoted 52 lines · Sean Paul
Quoted 43 lines · Ramalingam C
Quoted 41 lines · Sean Paul
From: Sean Paul <[email protected]>
The SRM cleanup in
79643fddd6eb2("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_srmsuch that we won't end up trying to parse the ksv list if there is an error fetching it.Fixes 79643fddd6eb ("drm/hdcp: optimizing the srm handling")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]>Signed-off-by Sean Paul <[email protected]>Changes in v2:
-Noticed a couple other things to clean up
---Sorry for the quick rev, noticed a couple other loose ends that should be cleaned up.
drivers/gpu/drm/drm_hdcp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_hdcp.c +0
-0@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev,Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 246
Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +3
-1ret =request_firmware_direct (&fw, (const char *)fw_name, drm_dev->dev); -if (ret <0 ) +if (ret <0 ) { + *revoked_ksv_cnt =0 ; + *revoked_ksv_list =NULL ;These two variables are already initialized by the caller.
Quoted 3 lines
Right now it is, but that's not guaranteed. In the ret == 0 case, it's pretty common for a caller to assume the called function has validated/assigned all the function output.
Ok.
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 247
Quoted 2 lines
drivers/gpu/drm/drm_hdcp.c +1
-0+ ret =0 ;Missing of this should have been caught by CI. May be CI system always having the SRM file from previous execution. Never been removed. IGT need a fix to clean the prior SRM files before execution.
CI fix shouldn't block this fix.
Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c +1
-0goto exit; + }if (fw->size && fw->data) 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,
Quoted 8 lines
Quoted 5 lines
drivers/gpu/drm/drm_hdcp.c int drm_hdcp_check_ksvs_revoked(struct drm_device *drm_dev, u8 *ksvs, · line 295
Quoted 4 lines
drivers/gpu/drm/drm_hdcp.c +2
-0ret =drm_hdcp_request_srm (drm_dev, &revoked_ksv_list, &revoked_ksv_cnt); +if (ret) +return ret;This error code also shouldn't effect the caller(i915)
Why not? I'd assume an invalid SRM revocation list should probably be treated as failure?
IMHO invalid SRM revocation need not be treated as HDCP authentication failure.
First of all SRM need not supplied by all players. and incase, supplied SRM is not as per the spec, then we dont have any list of revoked ID. with this I dont think we need to fail the HDCP authentication. Until we have valid list of revoked IDs from SRM, and the receiver ID is matching to one of the revoked IDs, I wouldn't want to fail the HDCP authentication.
-Ram
Quoted 9 lines
Quoted 9 lines
hence pushed a
change https://patchwork.freedesktop.org/series/76730/With these addresed.
LGTM.
Quoted 7 lines
Quoted 7 lines
Reviewed-by Ramalingam C <[email protected]>Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +0
-1/* revoked_ksv_cnt will be zero when above function failed */ for (i =0 ; i < revoked_ksv_cnt; i++) --Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 83 lines · Ramalingam C
Quoted 52 lines · Sean Paul
Quoted 43 lines · Ramalingam C
Quoted 41 lines · Sean Paul
From: Sean Paul <[email protected]>
The SRM cleanup in
79643fddd6eb2("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_srmsuch that we won't end up trying to parse the ksv list if there is an error fetching it.Fixes 79643fddd6eb ("drm/hdcp: optimizing the srm handling")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]>Signed-off-by Sean Paul <[email protected]>Changes in v2:
-Noticed a couple other things to clean up
---Sorry for the quick rev, noticed a couple other loose ends that should be cleaned up.
drivers/gpu/drm/drm_hdcp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_hdcp.c +0
-0@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev,Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 246
Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +3
-1ret =request_firmware_direct (&fw, (const char *)fw_name, drm_dev->dev); -if (ret <0 ) +if (ret <0 ) { + *revoked_ksv_cnt =0 ; + *revoked_ksv_list =NULL ;These two variables are already initialized by the caller.
Quoted 3 lines
Right now it is, but that's not guaranteed. In the ret == 0 case, it's pretty common for a caller to assume the called function has validated/assigned all the function output.
Ok.
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 247
Quoted 2 lines
drivers/gpu/drm/drm_hdcp.c +1
-0+ ret =0 ;Missing of this should have been caught by CI. May be CI system always having the SRM file from previous execution. Never been removed. IGT need a fix to clean the prior SRM files before execution.
CI fix shouldn't block this fix.
Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c +1
-0goto exit; + }if (fw->size && fw->data) 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,Quoted 8 lines
Quoted 5 lines
drivers/gpu/drm/drm_hdcp.c int drm_hdcp_check_ksvs_revoked(struct drm_device *drm_dev, u8 *ksvs, · line 295
Quoted 4 lines
drivers/gpu/drm/drm_hdcp.c +2
-0ret =drm_hdcp_request_srm (drm_dev, &revoked_ksv_list, &revoked_ksv_cnt); +if (ret) +return ret;This error code also shouldn't effect the caller(i915)
Why not? I'd assume an invalid SRM revocation list should probably be treated as failure?
IMHO invalid SRM revocation need not be treated as HDCP authentication failure.
Quoted 7 lines
First of all SRM need not supplied by all players. and incase, supplied SRM is not as per the spec, then we dont have any list of revoked ID. with this I dont think we need to fail the HDCP authentication. Until we have valid list of revoked IDs from SRM, and the receiver ID is matching to one of the revoked IDs, I wouldn't want to fail the HDCP authentication.
Ok, thanks for the explanation. This all seems reasonable to me.
Looks like this can be applied as-is, right? I'll review the patch you posted so we can ignore the -ve return values.
Thanks for the review!
Sean
Quoted 17 lines
-Ram
Quoted 16 lines
Quoted 16 lines
hence pushed a
change https://patchwork.freedesktop.org/series/76730/With these addresed.
LGTM.
Reviewed-by Ramalingam C <[email protected]>Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +0
-1/* revoked_ksv_cnt will be zero when above function failed */ for (i =0 ; i < revoked_ksv_cnt; i++) --Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 92 lines · Sean Paul
Quoted 83 lines · Ramalingam C
Quoted 52 lines · Sean Paul
Quoted 43 lines · Ramalingam C
Quoted 41 lines · Sean Paul
From: Sean Paul <[email protected]>
The SRM cleanup in
79643fddd6eb2("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_srmsuch that we won't end up trying to parse the ksv list if there is an error fetching it.Fixes 79643fddd6eb ("drm/hdcp: optimizing the srm handling")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]>Signed-off-by Sean Paul <[email protected]>Changes in v2:
-Noticed a couple other things to clean up
---Sorry for the quick rev, noticed a couple other loose ends that should be cleaned up.
drivers/gpu/drm/drm_hdcp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_hdcp.c +0
-0@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev,Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 246
Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +3
-1ret =request_firmware_direct (&fw, (const char *)fw_name, drm_dev->dev); -if (ret <0 ) +if (ret <0 ) { + *revoked_ksv_cnt =0 ; + *revoked_ksv_list =NULL ;These two variables are already initialized by the caller.
Quoted 3 lines
Right now it is, but that's not guaranteed. In the ret == 0 case, it's pretty common for a caller to assume the called function has validated/assigned all the function output.
Ok.
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 247
Quoted 2 lines
drivers/gpu/drm/drm_hdcp.c +1
-0+ ret =0 ;Missing of this should have been caught by CI. May be CI system always having the SRM file from previous execution. Never been removed. IGT need a fix to clean the prior SRM files before execution.
CI fix shouldn't block this fix.
Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c +1
-0goto exit; + }if (fw->size && fw->data) 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,Quoted 8 lines
Quoted 5 lines
drivers/gpu/drm/drm_hdcp.c int drm_hdcp_check_ksvs_revoked(struct drm_device *drm_dev, u8 *ksvs, · line 295
Quoted 4 lines
drivers/gpu/drm/drm_hdcp.c +2
-0ret =drm_hdcp_request_srm (drm_dev, &revoked_ksv_list, &revoked_ksv_cnt); +if (ret) +return ret;This error code also shouldn't effect the caller(i915)
Why not? I'd assume an invalid SRM revocation list should probably be treated as failure?
IMHO invalid SRM revocation need not be treated as HDCP authentication failure.
Quoted 7 lines
First of all SRM need not supplied by all players. and incase, supplied SRM is not as per the spec, then we dont have any list of revoked ID. with this I dont think we need to fail the HDCP authentication. Until we have valid list of revoked IDs from SRM, and the receiver ID is matching to one of the revoked IDs, I wouldn't want to fail the HDCP authentication.
Quoted 3 lines
Ok, thanks for the explanation. This all seems reasonable to me.
Looks like this can be applied as-is, right?
Yes.
Thanks,
Ram
Quoted 24 lines
I'll review the patch you
posted so we can ignore the -ve return values.Thanks for the review!
Sean
Quoted 17 lines
-Ram
Quoted 16 lines
Quoted 16 lines
hence pushed a
change https://patchwork.freedesktop.org/series/76730/With these addresed.
LGTM.
Reviewed-by Ramalingam C <[email protected]>Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +0
-1/* revoked_ksv_cnt will be zero when above function failed */ for (i =0 ; i < revoked_ksv_cnt; i++) --Sean Paul, Software Engineer, Google / Chromium OS
Sean Paul
AppliedQuoted 94 lines · Ramalingam C
Quoted 92 lines · Sean Paul
Quoted 90 lines · Ramalingam C
Quoted 52 lines · Sean Paul
Quoted 43 lines · Ramalingam C
Quoted 41 lines · Sean Paul
From: Sean Paul <[email protected]>
The SRM cleanup in
79643fddd6eb2("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_srmsuch that we won't end up trying to parse the ksv list if there is an error fetching it.Fixes 79643fddd6eb ("drm/hdcp: optimizing the srm handling")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]>Signed-off-by Sean Paul <[email protected]>Changes in v2:
-Noticed a couple other things to clean up
---Sorry for the quick rev, noticed a couple other loose ends that should be cleaned up.
drivers/gpu/drm/drm_hdcp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_hdcp.c +0
-0@@ -241,8 +241,12 @@ static int drm_hdcp_request_srm(struct drm_device *drm_dev,Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 246
Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +3
-1ret =request_firmware_direct (&fw, (const char *)fw_name, drm_dev->dev); -if (ret <0 ) +if (ret <0 ) { + *revoked_ksv_cnt =0 ; + *revoked_ksv_list =NULL ;These two variables are already initialized by the caller.
Quoted 3 lines
Right now it is, but that's not guaranteed. In the ret == 0 case, it's pretty common for a caller to assume the called function has validated/assigned all the function output.
Ok.
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/drm_hdcp.c static int drm_hdcp_request_srm(struct drm_device *drm_dev, · line 247
Quoted 2 lines
drivers/gpu/drm/drm_hdcp.c +1
-0+ ret =0 ;Missing of this should have been caught by CI. May be CI system always having the SRM file from previous execution. Never been removed. IGT need a fix to clean the prior SRM files before execution.
CI fix shouldn't block this fix.
Quoted 7 lines
drivers/gpu/drm/drm_hdcp.c +1
-0goto exit; + }if (fw->size && fw->data) 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,Quoted 8 lines
Quoted 5 lines
drivers/gpu/drm/drm_hdcp.c int drm_hdcp_check_ksvs_revoked(struct drm_device *drm_dev, u8 *ksvs, · line 295
Quoted 4 lines
drivers/gpu/drm/drm_hdcp.c +2
-0ret =drm_hdcp_request_srm (drm_dev, &revoked_ksv_list, &revoked_ksv_cnt); +if (ret) +return ret;This error code also shouldn't effect the caller(i915)
Why not? I'd assume an invalid SRM revocation list should probably be treated as failure?
IMHO invalid SRM revocation need not be treated as HDCP authentication failure.
First of all SRM need not supplied by all players. and incase, supplied SRM is not as per the spec, then we dont have any list of revoked ID. with this I dont think we need to fail the HDCP authentication. Until we have valid list of revoked IDs from SRM, and the receiver ID is matching to one of the revoked IDs, I wouldn't want to fail the HDCP authentication.
Quoted 5 lines
Quoted 3 lines
Ok, thanks for the explanation. This all seems reasonable to me.
Looks like this can be applied as-is, right?
Yes.
Applied to drm-misc-fixes
Sean
Quoted 27 lines
Thanks,
RamQuoted 24 lines
I'll review the patch you
posted so we can ignore the -ve return values.Thanks for the review!
Sean
Quoted 17 lines
-Ram
Quoted 16 lines
Quoted 16 lines
hence pushed a
change https://patchwork.freedesktop.org/series/76730/With these addresed.
LGTM.
Reviewed-by Ramalingam C <[email protected]>Quoted 6 lines
drivers/gpu/drm/drm_hdcp.c +0
-1/* revoked_ksv_cnt will be zero when above function failed */ for (i =0 ; i < revoked_ksv_cnt; i++) --Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm: Fix HDCP failures when SRM fw is missing (rev2)
In reply to Sean Paul== Series Details ==
== Series Details ==
Series: drm: Fix HDCP failures when SRM fw is missing (rev2)
URL : https://patchwork.freedesktop.org/series/75938/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
e0a6dea979f6 drm: Fix HDCP failures when SRM fw is missing
-:6: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 79643fddd6eb ("drm/hdcp: optimizing the srm handling")'
#6:
The SRM cleanup in 79643fddd6eb2 ("drm/hdcp: optimizing the srmtotal: 1 errors, 0 warnings, 0 checks, 21 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.DOCS: warning for drm: Fix HDCP failures when SRM fw is missing (rev2)
In reply to Sean Paul== Series Details ==
== Series Details ==
Series: drm: Fix HDCP failures when SRM fw is missing (rev2)
URL : https://patchwork.freedesktop.org/series/75938/
State : warning
== Summary ==
$ make htmldocs 2>&1 > /dev/null | grep i915 /home/cidrm/kernel/Documentation/gpu/i915.rst:610: WARNING: duplicate label gpu/i915:layout, other instance in /home/cidrm/kernel/Documentation/gpu/i915.rst
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for drm: Fix HDCP failures when SRM fw is missing (rev2)
In reply to Sean Paul== Series Details ==
== Series Details ==
Series: drm: Fix HDCP failures when SRM fw is missing (rev2)
URL : https://patchwork.freedesktop.org/series/75938/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8298 -> Patchwork_17299
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_17299 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_17299, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17299/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_17299:
### IGT changes ###
#### Possible regressions ####
* igt@runner@aborted:
- fi-bsw-n3050: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17299/fi-bsw-n3050/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_17299 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@gt_lrc:
- fi-bsw-n3050: [PASS][2] -> [INCOMPLETE][3] ([i915#1436])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8298/fi-bsw-n3050/igt@i915_selftest@live@gt_lrc.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17299/fi-bsw-n3050/igt@i915_selftest@live@gt_lrc.html
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
Participating hosts (48 -> 44)
------------------------------
Missing (4): fi-byt-clapper fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8298 -> Patchwork_17299
CI-20190529: 20190529
CI_DRM_8298: 17f82f0c2857d0b442adbdb62eb44b61d0f5b775 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5589: 31962324ac86f029e2841e56e97c42cf9d572956 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17299: e0a6dea979f6de3160fd4579d029c45131e86c69 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
e0a6dea979f6 drm: Fix HDCP failures when SRM fw is missing
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17299/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx