Bug 51846 - unix_chkpwd segfaults on empty password
Summary: unix_chkpwd segfaults on empty password
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: pam
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-15 19:25 UTC by ahosey
Modified: 2007-04-18 16:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-08-15 19:25:31 UTC
Embargoed:


Attachments (Terms of Use)

Description ahosey 2001-08-15 19:25:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.3-ac7 i686; Nav)

Description of problem:
If the unix_chkpwd program gets an empty password as input, it calls the
internal _unix_verify_password() function with NULL as the second argument
(the password.) This is supposed to be okay, but passing NULL to the
bigcrypt() function gives a segfault. A script is below.

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


How reproducible:
Always

Steps to Reproduce:
This script will segfault unix_chkpwd:

#!/usr/bin/perl -w

pipe (FROM_PARENT, TO_CHILD);

if ($pid = fork) {
# I am the parent
close FROM_PARENT;
printf TO_CHILD "nullok%c%c", 0, 0;
print TO_CHILD "";
close TO_CHILD;
waitpid($pid, 0);
$childexit = $?;
print "child exited with $childexit\n";
} else {
die "cannot fork: $!" unless defined $pid;
# I am the child
open (STDIN, "<&FROM_PARENT") or die "$!";
exec '/sbin/unix_chkpwd' or die "cannot exec: $!";
}
exit;



Actual Results:  Get this in syslog:

Aug 15 14:18:13 thunderclap unix_chkpwd[10441]: caught signal 11.

Expected Results:  unix_chkpwd should return the failure code without
segfaulting.

Additional info:

I think passing "" instead of NULL to _unix_verify_password() will give the
desired results.

Comment 1 Nalin Dahyabhai 2001-08-31 03:29:01 UTC
Fixing in 0.75-11.  Thanks!


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