Bug 51846

Summary: unix_chkpwd segfaults on empty password
Product: [Retired] Red Hat Linux Reporter: ahosey
Component: pamAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2   
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: 2001-08-15 19:25:31 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 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!