Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15:Update
ipmitool
session-Fix-buffer-overflow-in-ipmi_get_session...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File session-Fix-buffer-overflow-in-ipmi_get_session_info.patch of Package ipmitool
From: Chrostoper Ertl <chertl@microsoft.com> Subject: session: Fix buffer overflow in ipmi_get_session_info References: bsc#1163026, CVE-2020-5208 Patch-Mainline: Git-commit: 41d7026946fafbd4d1ec0bcaca3ea30a6e8eed22 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_get_session_info` function does not properly check the response `data_len`, which is used as a copy size, allowing stack buffer overflow. Signed-off-by: <trenn@suse.com> diff --git a/lib/ipmi_session.c b/lib/ipmi_session.c index ecf4afc..b282d6d 100644 --- a/lib/ipmi_session.c +++ b/lib/ipmi_session.c @@ -309,8 +309,10 @@ ipmi_get_session_info(struct ipmi_intf * intf, } else { - memcpy(&session_info, rsp->data, rsp->data_len); - print_session_info(&session_info, rsp->data_len); + memcpy(&session_info, rsp->data, + __min(rsp->data_len, sizeof(session_info))); + print_session_info(&session_info, + __min(rsp->data_len, sizeof(session_info))); } break; @@ -341,8 +343,10 @@ ipmi_get_session_info(struct ipmi_intf * intf, break; } - memcpy(&session_info, rsp->data, rsp->data_len); - print_session_info(&session_info, rsp->data_len); + memcpy(&session_info, rsp->data, + __min(rsp->data_len, sizeof(session_info))); + print_session_info(&session_info, + __min(rsp->data_len, sizeof(session_info))); } while (i <= session_info.session_slot_count); break;
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