Bug 816203 - yppasswd doesn't handle crypt() returning NULL
yppasswd doesn't handle crypt() returning NULL
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yp-tools (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Honza Horak
: Patch
Depends On: 814803
Blocks: 816201
  Show dependency treegraph
Reported: 2012-04-25 09:35 EDT by Honza Horak
Modified: 2013-03-13 13:55 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 814803
Last Closed: 2013-03-13 13:55:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch which prints error and exists when crypt fails (2.44 KB, patch)
2012-12-03 08:49 EST, Honza Horak
no flags Details | Diff

  None (edit)
Description Honza Horak 2012-04-25 09:35:02 EDT
+++ This bug was initially created as a clone of Bug #814803 +++

Created attachment 579069 [details]
yp-tools spec file

yppasswd doesn't handle crypt() returning NULL, which is possible in fips mode and other corner conditions. It blindly tries to sntrcmp or strdup the return
values of crypt()

Attached is a patch and updated spec file for rawhide

--- Additional comment from pwouters@redhat.com on 2012-04-20 13:48:13 EDT ---

Created attachment 579072 [details]
patch hanlding crypt() returning NULL

As I do not have an existing YP/NIS setup, someone should really test this patch

--- Additional comment from hhorak@redhat.com on 2012-04-23 09:18:49 EDT ---

Thanks for reporting. I've pushed the patch to upstream, applied in Rawhide and will update in F17 soon.

Right now, I'm not going to apply the patch and update in F16 and F15 though, unless there is a real use case requiring this fix or some more significant fix.

--- Additional comment from updates@fedoraproject.org on 2012-04-23 09:20:45 EDT ---

yp-tools-2.12-9.fc17 has been submitted as an update for Fedora 17.

--- Additional comment from pwouters@redhat.com on 2012-04-23 22:12:48 EDT ---

no need for f16, f15. Though RHEL would be nice :)

--- Additional comment via e-mail from sgrubb@redhat.com on 2012-04-23 23:19:48 EDT ---

The Single Unix Spec documents crypt() as being able to return NULL under certain conditions that are not related to FIPS. So, all software needs to handle this possibility. But there have been some recent changes in glibc that make it more likely that you will hit this. Especially if the user can control the input. I'd update everywhere that you can get a QE slot. RHEL5 FIPS support is supposed to be good. But I don't know if the glibc developers also updated it in a way that makes this more likely now.
Comment 1 RHEL Product and Program Management 2012-06-11 21:15:19 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 2 Honza Horak 2012-12-03 08:49:51 EST
Created attachment 656639 [details]
Patch which prints error and exists when crypt fails
Comment 3 Honza Horak 2013-03-13 13:55:29 EDT
There is no chance to fix this in RHEL-5 any more, since RHEL 5.10 is going to include only serious fixes.

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