Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 83056 - textutils /bin/cut input validation error
Summary: textutils /bin/cut input validation error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: textutils
Version: 8.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-01-29 21:28 UTC by Wojtek Sobola
Modified: 2007-04-18 16:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-12-10 13:08:39 UTC


Attachments (Terms of Use)

Description Wojtek Sobola 2003-01-29 21:28:19 UTC
Description of problem:
/bin/cut has following input validation problem:

22:16:34 [wojtek ~]$ gdb /bin/cut
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...(no debugging symbols found)...
(gdb) run -b -9999999999999999
Starting program: /bin/cut -b -9999999999999999
/bin/cut: memory exhausted
(no debugging symbols found)...(no debugging symbols found)...
Program exited with code 01.
(gdb) run -b -9999999999999999999999999999999999999999
Starting program: /bin/cut -b -9999999999999999999999999999999999999999
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x08048fbf in set_fields ()
(gdb) bt
#0  0x08048fbf in set_fields ()
#1  0x0804995c in main ()
#2  0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
(gdb)

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

How reproducible:
/bin/cut -b -99999999999999999999999999999999

Steps to Reproduce:
1. above
2.
3.
    
Actual results:
SIGSEGV or Mem Exhausted

Expected results:


Additional info:
Can lead to overwrite mem of other processes (not checked).

Comment 1 Tim Waugh 2003-01-29 23:37:35 UTC
> Can lead to overwrite mem of other processes (not checked).

Linux uses memory protection to prevent one process from accidentally
overwriting the memory of another.

But I agree that it's bad behaviour for cut.


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