Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miss checking whether spdm_response_size < sizeof(spdm_csr_response_t) + spdm_response-> csr_length before libspdm_copy_mem. #2651

Closed
Zhiqiang520 opened this issue Apr 2, 2024 · 0 comments · Fixed by #2652
Assignees
Labels
bug Something isn't working

Comments

@Zhiqiang520
Copy link
Contributor

Miss checking whether spdm_response_size < sizeof(spdm_csr_response_t) + spdm_response-> csr_length before libspdm_copy_mem.

I think we should check whether spdm_response_size < sizeof(spdm_csr_response_t) + spdm_response-> csr_length before libspdm_copy_mem at the line 212.

if (*csr_len < spdm_response->csr_length) {
*csr_len = spdm_response->csr_length;
status = LIBSPDM_STATUS_BUFFER_TOO_SMALL;
goto receive_done;
}
libspdm_copy_mem(csr, *csr_len, spdm_response + 1, spdm_response->csr_length);

@jyao1 jyao1 added the bug Something isn't working label Apr 2, 2024
Wenxing-hou added a commit to Wenxing-hou/libspdm that referenced this issue Apr 2, 2024
Fix the issue: DMTF#2649
Fix the issue: DMTF#2651

Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
Wenxing-hou added a commit to Wenxing-hou/libspdm that referenced this issue Apr 2, 2024
Fix the issue: DMTF#2649
Fix the issue: DMTF#2651

Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
jyao1 pushed a commit that referenced this issue Apr 3, 2024
Fix the issue: #2649
Fix the issue: #2651

Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants