Skip to content

Commit

Permalink
Fix error when checking number_of_ckids in cxl_tsp_validate_capability
Browse files Browse the repository at this point in the history
According to CXL Spec 3.1 Table 11-32 Get Target Capabilities Response
(Sheet 3 of 3) Byte Offset (1Ch):
  Number of CKIDs: Total number of CKIDs that the target supports.
  Valid only if CKID-based Encryption is set in Memory Encryption Features
  Supported. Shall be >=2 and < 2^13.

One of the condition shall be:
  device_capabilities->number_of_ckids >= 0x2000

Signed-off-by: Min M Xu <[email protected]>
  • Loading branch information
mxu9 committed Nov 20, 2024
1 parent 6ae0831 commit 34611a4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ cxl_tsp_validate_capability (

if ((memory_encryption_features_supported & CXL_TSP_MEMORY_ENCRYPTION_FEATURES_SUPPORT_CKID_BASED_ENCRYPTION) != 0) {
if ((device_capabilities->number_of_ckids < 2) ||
(device_capabilities->number_of_ckids > 0x2000)) {
(device_capabilities->number_of_ckids >= 0x2000)) {
return LIBSPDM_STATUS_INVALID_MSG_FIELD;
}
}
Expand Down

0 comments on commit 34611a4

Please sign in to comment.