mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
channel: Fix buffer overflow
Partial fix for CVE-2020-5208, see https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp The `ipmi_get_channel_cipher_suites` function does not properly check the final response’s `data_len`, which can lead to stack buffer overflow on the final copy.
This commit is contained in:
parent
41d7026946
commit
9452be8718
@ -498,7 +498,10 @@ ipmi_get_channel_cipher_suites(struct ipmi_intf *intf,
|
|||||||
lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites");
|
lprintf(LOG_ERR, "Unable to Get Channel Cipher Suites");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (rsp->ccode || rsp->data_len < 1) {
|
if (rsp->ccode
|
||||||
|
|| rsp->data_len < 1
|
||||||
|
|| rsp->data_len > sizeof(uint8_t) + MAX_CIPHER_SUITE_DATA_LEN)
|
||||||
|
{
|
||||||
lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s",
|
lprintf(LOG_ERR, "Get Channel Cipher Suites failed: %s",
|
||||||
val2str(rsp->ccode, completion_code_vals));
|
val2str(rsp->ccode, completion_code_vals));
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user