- Fixed buffer overflow in alloc_rootdir_entry (#674095)

- Dropped fix-reclaim-file patch, obsoleted by fix-alloc-rootdir-entry patch
This commit is contained in:
Jaroslav Škarvada 2011-02-14 15:43:34 +01:00
parent f1093c3eae
commit 8de1eb801e
3 changed files with 22 additions and 15 deletions

View File

@ -0,0 +1,14 @@
--- dosfstools-3.0.9/src/check.c.old 2010-01-23 10:13:17.000000000 +0100
+++ dosfstools-3.0.9/src/check.c 2011-01-31 17:43:31.462674941 +0100
@@ -174,7 +174,10 @@
offset = fs->root_start+next_free*sizeof(DIR_ENT);
memset(de,0,sizeof(DIR_ENT));
while (1) {
- sprintf(de->name,pattern,curr_num);
+ char expanded[12];
+ sprintf(expanded, pattern, curr_num);
+ memcpy(de->name, expanded, 8);
+ memcpy(de->ext, expanded+8, 3);
for (scan = 0; scan < fs->root_entries; scan++)
if (scan != next_free &&
!strncmp(root[scan].name,de->name,MSDOS_NAME))

View File

@ -1,11 +0,0 @@
--- dosfstools-3.0.9/src/fat.c.old 2010-01-23 10:13:34.000000000 +0100
+++ dosfstools-3.0.9/src/fat.c 2010-12-10 14:36:29.510247580 +0100
@@ -486,7 +486,7 @@
DIR_ENT de;
loff_t offset;
files++;
- offset = alloc_rootdir_entry(fs,&de,"FSCK%04dREC");
+ offset = alloc_rootdir_entry(fs,&de,"FSCK%04d");
de.start = CT_LE_W(i&0xffff);
if (fs->fat_bits == 32)
de.starthi = CT_LE_W(i>>16);

View File

@ -1,14 +1,14 @@
Name: dosfstools
Summary: Utilities for making and checking MS-DOS FAT filesystems on Linux
Version: 3.0.9
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv3+
Group: Applications/System
Source0: http://www.daniel-baumann.ch/software/dosfstools/%{name}-%{version}.tar.bz2
URL: http://www.daniel-baumann.ch/software/dosfstools/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Fix buffer overflow in reclaim file (#660154)
Patch0: dosfstools-3.0.9-fix-reclaim-file.patch
# Fix buffer overflow in alloc_rootdir_entry (#674095)
Patch0: dosfstools-3.0.9-fix-alloc-rootdir-entry.patch
%description
The dosfstools package includes the mkdosfs and dosfsck utilities,
@ -17,7 +17,7 @@ drives or on floppies.
%prep
%setup -q
%patch0 -p1 -b .fix-reclaim-file
%patch0 -p1 -b .fix-alloc-rootdir-entry
%build
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing"
@ -36,6 +36,10 @@ rm -rf %{buildroot}
%{_mandir}/man8/*
%changelog
* Mon Jan 31 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 3.0.9-5
- Fixed buffer overflow in alloc_rootdir_entry (#674095)
- Dropped fix-reclaim-file patch, obsoleted by fix-alloc-rootdir-entry patch
* Fri Jan 07 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 3.0.9-4
- Fixed buffer overflow in reclaim file (#660154)