Bug 480112

Summary: mtools fails
Product: [Fedora] Fedora Reporter: Bill Nottingham <notting>
Component: mtoolsAssignee: Adam Tkac <atkac>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: atkac, katzj, ovasik, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-21 18:44:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 476773    

Description Bill Nottingham 2009-01-15 04:53:59 UTC
Description of problem:

In file_name.c:

wchar_t *unix_name(doscp_t *dosCp, ...

        char *s, tname[9], text[4], ans[11];
...
        if (*text) {
                strcpy(ans, tname);
                strcat(ans, ".");
                strcat(ans, text);
        }

Oddly enough...

/usr/bin/mcopy -D o -D O -o - s:/ldlinux.sys
*** buffer overflow detected ***: /usr/bin/mcopy terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7ffff7b4d717]
/lib64/libc.so.6[0x7ffff7b4b5c0]
/lib64/libc.so.6[0x7ffff7b4a3ad]
/usr/bin/mcopy[0x40a33f]
/usr/bin/mcopy[0x41ce5b]
/usr/bin/mcopy[0x41570d]
/usr/bin/mcopy[0x41592e]
/usr/bin/mcopy[0x40e915]

Version-Release number of selected component (if applicable):

mtools-4.0.0-2.fc11.x86_64

Comment 1 Jeremy Katz 2009-01-16 16:40:54 UTC
This stops people from using live images off of a USB stick, so sticking on the alpha blocker list.

Comment 2 Adam Tkac 2009-01-21 12:08:36 UTC
(In reply to comment #0)
> Description of problem:
> 
> In file_name.c:
> 
> wchar_t *unix_name(doscp_t *dosCp, ...
> 
>         char *s, tname[9], text[4], ans[11];
> ...
>         if (*text) {
>                 strcpy(ans, tname);
>                 strcat(ans, ".");
>                 strcat(ans, text);
>         }
> 
> Oddly enough...
> 

It is a bug but I'm not 100% sure that your crash is due this "off-by-two" error. Could you attach backtrace/core dump, please? Thanks

Comment 3 Bill Nottingham 2009-01-21 18:26:05 UTC
Don't have it at the moment. However, a s/11/13/ patch makes it not happen.

Comment 4 Adam Tkac 2009-01-21 18:44:55 UTC
fixed in mtools-4.0.0-3.fc11