Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:GA
ipmitool.14274
fru-Fix-buffer-overflow-in-ipmi_spd_print_fru.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fru-Fix-buffer-overflow-in-ipmi_spd_print_fru.patch of Package ipmitool.14274
From: Chrostoper Ertl <chertl@microsoft.com> Subject: fru: Fix buffer overflow in ipmi_spd_print_fru References: bsc#1163026, CVE-2020-5208 Patch-Mainline: Git-commit: 840fb1cbb4fb365cb9797300e3374d4faefcdb10 Git-repo: https://github.com/ipmitool/ipmitool.git.git Partial fix for CVE-2020-5208, see https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp The `ipmi_spd_print_fru` function has a similar issue as the one fixed by the previous commit in `read_fru_area_section`. An initial request is made to get the `fru.size`, which is used as the size for the allocation of `spd_data`. Inside a loop, further requests are performed to get the copy sizes which are not checked before being used as the size for a copy into the buffer. Signed-off-by: <trenn@suse.com> diff --git a/lib/dimm_spd.c b/lib/dimm_spd.c index 163a2c2..d559cb4 100644 --- a/lib/dimm_spd.c +++ b/lib/dimm_spd.c @@ -1621,7 +1621,7 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id) struct ipmi_rq req; struct fru_info fru; uint8_t *spd_data, msg_data[4]; - int len, offset; + uint32_t len, offset; msg_data[0] = id; @@ -1697,6 +1697,13 @@ ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id) } len = rsp->data[0]; + if(rsp->data_len < 1 + || len > rsp->data_len - 1 + || len > fru.size - offset) + { + printf(" Not enough buffer size"); + return -1; + } memcpy(&spd_data[offset], rsp->data + 1, len); offset += len; } while (offset < fru.size);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor