Bug 2045572
| Summary: | CVE-2022-0367 libmodbus: Heap-based Buffer Overflow in modbus_reply [fedora-all] | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Pedro Sampaio <psampaio> |
| Component: | libmodbus | Assignee: | Eric Sandeen <esandeen> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 35 | CC: | esandeen, john, stephane.raimbault |
| Target Milestone: | --- | Keywords: | Security, SecurityTracking |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-02-04 18:25:11 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2045571 | ||
|
Description
Pedro Sampaio
2022-01-25 17:32:47 UTC
Use the following template to for the 'fedpkg update' request to submit an update for this issue as it contains the top-level parent bug(s) as well as this tracking bug. This will ensure that all associated bugs get updated when new packages are pushed to stable. ===== # bugfix, security, enhancement, newpackage (required) type=security # low, medium, high, urgent (required) severity=medium # testing, stable request=testing # Bug numbers: 1234,9876 bugs=2045571,2045572 # Description of your update notes=Security fix for [PUT CVEs HERE] # Enable request automation based on the stable/unstable karma thresholds autokarma=True stable_karma=3 unstable_karma=-3 # Automatically close bugs when this marked as stable close_bugs=True # Suggest that users restart after update suggest_reboot=False ====== Additionally, you may opt to use the bodhi web interface to submit updates: https://bodhi.fedoraproject.org/updates/new Only rawhide is affected; all released versions are prior to the introduction of this bug.
The commit which introduced the cut and paste error was:
commit 933ed4d3e9f226a21274ff33ebc735d50d5f0be9
Author: Stéphane Raimbault <stephane.raimbault>
Date: Tue May 10 13:34:22 2016 +0200
Change API modbus_mapping_(offsets_new) to (new_start_address)
Related to 52ab1bbea760ed8eaca184f7d875a2f52a116d0f.
The arguments have been changed (see documentation).
https://groups.google.com/d/msg/libmodbus/aXO8nBzW4Ew/uVGTDmvvBAAJ
which did:
@@ -1041,15 +1050,15 @@ int modbus_reply(modbus_t *ctx, const uint8_t *req,
rsp_length = response_exception(
ctx, &sft,
MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, rsp);
- } else if (address < mb_mapping->offset_registers ||
- (addr + nb) > mb_mapping->nb_registers ||
- address_write < mb_mapping->offset_registers ||
- (addr_write + nb_write) > mb_mapping->nb_registers) {
+ } else if (mapping_address < 0 ||
+ (mapping_address + nb) > mb_mapping->nb_registers ||
+ mapping_address < 0 ||
+ (mapping_address_write + nb_write) > mb_mapping->nb_registers) {
if (ctx->debug) {
fprintf(stderr,
(note the 2nd "address_write" turned into "mapping_address" instead of "mapping_address" write) went into v3.1.3.
Older versions (i.e. anything older than rawhide) are not affected.
|