Bug 1336739 (CVE-2015-8872) - CVE-2015-8872 dosfstools: Off-by-2 error leading to corruption in FAT12
Summary: CVE-2015-8872 dosfstools: Off-by-2 error leading to corruption in FAT12
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2015-8872
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1337499
Blocks: 1336747
TreeView+ depends on / blocked
 
Reported: 2016-05-17 11:26 UTC by Andrej Nemec
Modified: 2019-09-29 13:49 UTC (History)
1 user (show)

Fixed In Version: dosfstools 4.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-19 10:38:18 UTC


Attachments (Terms of Use)

Description Andrej Nemec 2016-05-17 11:26:49 UTC
A vulnerability was found in dosfstools. In FAT12 two 12 bit entries are combined to a 24 bit value (three bytes). Therefore, when an even numbered FAT entry is set in FAT12, it must be be combined with the following entry. To prevent accessing beyond the end of the FAT array, it must be checked that the cluster is not the last one.

Previously, the check tested that the requested cluster was equal to fs->clusters - 1. However, fs->clusters is the number of data clusters not including the two reserved FAT entries at the start so the test triggered two clusters early.

If the third to last entry was written on a FAT12 filesystem with an odd number of clusters, the second to last entry would be corrupted. This corruption may also lead to invalid memory accesses when the corrupted entry becomes out of bounds and is used later.

External references:

https://github.com/dosfstools/dosfstools/issues/12
https://blog.fuzzing-project.org/44-dosfstools-fsck.vfat-Several-invalid-memory-accesses.html


Upstream fix:

https://github.com/dosfstools/dosfstools/commit/07908124838afcc99c577d1d3e84cef2dbd39cb7

Comment 1 Huzaifa S. Sidhpurwala 2016-05-19 10:36:24 UTC
Created dosfstools tracking bugs for this issue:

Affects: fedora-all [bug 1337499]

Comment 2 Fedora Update System 2016-05-20 17:36:10 UTC
dosfstools-3.0.28-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 3 Fedora Update System 2016-05-20 23:50:06 UTC
dosfstools-3.0.28-3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2016-06-02 14:49:38 UTC
dosfstools-3.0.27-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.