Bug 83056 - textutils /bin/cut input validation error
textutils /bin/cut input validation error
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: textutils (Show other bugs)
8.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-29 16:28 EST by Wojtek Sobola
Modified: 2007-04-18 12:50 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-10 08:08:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wojtek Sobola 2003-01-29 16:28:19 EST
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 18:37:35 EST
> 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.