crypto: ccp: Fix checks for SNP_VLEK_LOAD input buffer length
Subsystems (3)
PATCH 1/1 crypto: ccp: Fix checks for SNP_VLEK_LOAD input buffer length
The SNP_VLEK_LOAD IOCTL currently fails due to sev_cmd_buffer_len() returning the default expected buffer length of 0 instead of the correct value, which would be sizeof(struct sev_user_data_snp_vlek_load). Add specific handling for SNP_VLEK_LOAD so the correct expected size is returned.
--- drivers/crypto/ccp/sev-dev.c | 1 + 1 file changed, 1 insertion(+)
drivers/crypto/ccp/sev-dev.c +1 -0
@@ -233,6 +233,7 @@ static int sev_cmd_buffer_len(int cmd)case SEV_CMD_SNP_GUEST_REQUEST :return sizeof (struct sev_data_snp_guest_request );case SEV_CMD_SNP_CONFIG :return sizeof (struct sev_user_data_snp_config );case SEV_CMD_SNP_COMMIT :return sizeof (struct sev_data_snp_commit ); +case SEV_CMD_SNP_VLEK_LOAD :return sizeof (struct sev_user_data_snp_vlek_load );default :return 0 ; }
Signature · 1 line
2.25.1
I think this should go to Herbert who's collecting crypto stuff.
To: [email protected] is perhaps not really the right place :)
Quoted 29 lines · Michael Roth
The
SNP_VLEK_LOADIOCTL currently fails due tosev_cmd_buffer_len()returning the default expected buffer length of 0 instead of the correct value, which would besizeof(struct sev_user_data_snp_vlek_load). Add specific handling forSNP_VLEK_LOADso the correct expected size is returned.Reported-by Diego GonzalezVillalobos <[email protected]>Cc Diego GonzalezVillalobos <[email protected]>Fixes 332d2c1d713e ("crypto: ccp: Add the SNP_VLEK_LOAD command")Signed-off-by Michael Roth <[email protected]>--- drivers/crypto/ccp/sev-dev.c | 1 + 1 file changed, 1 insertion(+)drivers/crypto/ccp/sev-dev.c +1
-0@@ -233,6 +233,7 @@ static int sev_cmd_buffer_len(int cmd)case SEV_CMD_SNP_GUEST_REQUEST :return sizeof (struct sev_data_snp_guest_request );case SEV_CMD_SNP_CONFIG :return sizeof (struct sev_user_data_snp_config );case SEV_CMD_SNP_COMMIT :return sizeof (struct sev_data_snp_commit ); +case SEV_CMD_SNP_VLEK_LOAD :return sizeof (struct sev_user_data_snp_vlek_load );default :return 0 ; }Signature · 1 line
2.25.1
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette