mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 21:35:13 -04:00
drm/i915/hdcp: require monotonically increasing seq_num_v
The HDCP 2.2 specification requires the seq_num_v to be monotonically increasing, and repeated seq_num_v needs to be treated as an integrity failure. Make it so. For the first message, seq_num_v must be zero, and is already checked. We can only check for less-than-or-equal for the subsequent messages, where hdcp2_encrypted is true. Discovered using AI-assisted static analysis confirmed by Intel Product Security. Reported-by: Martin Hodo <martin.hodo@intel.com> Fixes:d849178e2c("drm/i915: Implement HDCP2.2 repeater authentication") Cc: stable@vger.kernel.org # v5.2+ Cc: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://patch.msgid.link/20260625104407.1025614-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com> (cherry picked from commit58a224375c) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
This commit is contained in:
committed by
Joonas Lahtinen
parent
bbb15a6b04
commit
db9e64c983
@@ -1801,9 +1801,10 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (seq_num_v < hdcp->seq_num_v) {
|
||||
/* Roll over of the seq_num_v from repeater. Reauthenticate. */
|
||||
drm_dbg_kms(display->drm, "Seq_num_v roll over.\n");
|
||||
if (hdcp->hdcp2_encrypted && seq_num_v <= hdcp->seq_num_v) {
|
||||
/* Reauthenticate on Seq_num_v repeat or rollover */
|
||||
drm_dbg_kms(display->drm, "Seq_num_v %s\n",
|
||||
seq_num_v == hdcp->seq_num_v ? "repeat" : "rollover");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user