Bug 51846 - unix_chkpwd segfaults on empty password
unix_chkpwd segfaults on empty password
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: pam (Show other bugs)
6.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-15 15:25 EDT by ahosey
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-15 15:25:31 EDT
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 ahosey 2001-08-15 15:25:27 EDT
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-30 23:29:01 EDT
Fixing in 0.75-11.  Thanks!

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