Bug 29309

Summary: login dumps core
Product: [Retired] Red Hat Linux Reporter: Need Real Name <mal>
Component: util-linuxAssignee: Erik Troan <ewt>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0Keywords: Security
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-26 13:01:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-02-24 23:43:13 UTC
In the directory /root/
I found a file core which belongs to login program.
rpm -qf /bin/login 
util-linux-2.10m-12

The symbols are stripped, so the trace seems not very useful,
but you probably can extract the real trace 
by re-linking login with debugging symbols.

ls -l core 
-rw-------    1 root     root       491520 Feb 20 12:43 core

gdb /bin/login core
....
(gdb) bt
#0  strncpy (s1=0xbfffd61c "", s2=0x0, n=32) at
../sysdeps/generic/strncpy.c:41
#1  0x8049e6e in strcpy () at ../sysdeps/generic/strcpy.c:31
#2  0x7974742f in ?? ()
Cannot access memory at address 0x7665642f
(gdb) 

I can not tell why it happened, I just found a core file.
This may be a security problem, because if login has
some buffer overflow this will compromize everything.

The core is definitely from /bin/login:

#strings core |less
CORE
CORE
login
login      
CORE
login
CORE
 failure forking: %s
setuid() failed
No directory %s!
Logging in with home = "/".
login: no memory for shell script.
exec 
login: couldn't exec shell script: %s.
login: no shell: %s.
.....

Comment 1 Karsten Hopp 2001-02-26 13:01:06 UTC
This one is easy to reproduce:
- Login as normal user
- type 'login'
- hit CTRL-D a few times --> core dump

Comment 2 Karsten Hopp 2001-02-26 14:07:55 UTC
Upgrade to pam-0.74-12 fixed this