Bug 1008178 - curl scp download fails in fips mode
curl scp download fails in fips mode
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: curl (Show other bugs)
6.5
All Linux
urgent Severity medium
: rc
: ---
Assigned To: Kamil Dudka
Stefan Kremen
: Patch, ZStream
Depends On: 856100 968575
Blocks: 1182186
  Show dependency treegraph
 
Reported: 2013-09-15 09:48 EDT by Ondrej Moriš
Modified: 2015-07-22 01:42 EDT (History)
3 users (show)

See Also:
Fixed In Version: curl-7.19.7-43.el6
Doc Type: Bug Fix
Doc Text:
Previously, the implementation of SCP/SFTP protocols in libcurl did not properly handle failure of the libssh2_hostkey_hash() function from the libssh2 library. This resulted in abnormal process termination when the system was running in FIPS mode. An upstream patch has been applied on libcurl source code to properly handle such a case and the failure is now sanely propagated back to the application.
Story Points: ---
Clone Of:
: 1182186 (view as bug list)
Environment:
Last Closed: 2015-07-22 01:42:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Output of 'strace -f'. (50.94 KB, text/plain)
2013-09-15 09:49 EDT, Ondrej Moriš
no flags Details

  None (edit)
Description Ondrej Moriš 2013-09-15 09:48:35 EDT
Description of problem:

In FIPS mode, curl segfaults when downloading via scp (see details below). 

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

curl-7.19.7-37.el6_4

How reproducible:

100%

Steps to Reproduce:

1. add curltestuser account
   # useradd -m curltestuser
2. create a test file
   # su - curltestuser -c 'dd if=/dev/zero of=testfile bs=1M count=200'
3. Create ssh key (for FIPS you need RSA with more than 1024 bits)
   # ssh-keygen -t rsa -f /root/.ssh/id_rsa -N ''
   # mkdir /home/curltestuser/.ssh
   # cat /root/.ssh/id_rsa.pub > /home/curltestuser/.ssh/authorized_keys 
   # chown -R curltestuser.curltestuser /home/curltestuser/.ssh/
4. Initiate curl scp download
   # curl -v -o ./scp_file -u curltestuser: --key /root/.ssh/id_rsa \
     --pubkey /root/.ssh/id_rsa.pub scp://localhost/home/curltestuser

Actual results:

* About to connect() to localhost port 22 (#0)
*   Trying ::1... connected
* Connected to localhost (::1) port 22 (#0)
* Failed to read known hosts from /root/.ssh/known_hosts
Segmentation fault (core dumped)

Expected results:

Successful download.

Additional info:

This is not happening in a non-FIPS mode, where scp download works flawlessly.

Output from 'strace -f' is attached.
Comment 1 Ondrej Moriš 2013-09-15 09:49:03 EDT
Created attachment 797937 [details]
Output of 'strace -f'.
Comment 2 Kamil Dudka 2013-09-15 10:48:53 EDT
Looks like a duplicate of bug 968575.  Could you please check whether installing libssh2 from the private-bz968575 branch of dist-git fixes the problem?

Alternatively, I can check it myself if you have a RHEL-6 machines booting in FIPS that you can lend me for testing...
Comment 3 Kamil Dudka 2013-09-15 10:53:44 EDT
I just realized we have also bug 856100 against curl running in FIPS.  Chances are we will have to fix both in RHEL-6.  So we can use this bug as a RHEL-6 sibling of bug 856100.
Comment 5 Ondrej Moriš 2013-09-17 09:26:32 EDT
(In reply to Kamil Dudka from comment #2)
> Looks like a duplicate of bug 968575.  Could you please check whether
> installing libssh2 from the private-bz968575 branch of dist-git fixes the
> problem?
> 
> Alternatively, I can check it myself if you have a RHEL-6 machines booting
> in FIPS that you can lend me for testing...

Is this request still actual? I can test it easily (and I can give you rhel6 fips machine for a testing as well), I am just curious if BZ#856100 would not block me, if not, I can do it right away.
Comment 20 errata-xmlrpc 2015-07-22 01:42:57 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1254.html

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