Bug 2819

Summary: Problem with "scp -C" on specific files only.
Product: Portable OpenSSH Reporter: Mayank Sharma <mayasha9>
Component: scpAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: major CC: dtucker, mayasha9
Priority: P5    
Version: 7.5p1   
Hardware: PPC   
OS: AIX   
Attachments:
Description Flags
scp and sshd logs none

Description Mayank Sharma 2018-01-09 21:19:38 AEDT
Created attachment 3113 [details]
scp and sshd logs

Hello Team ,
"scp -C" (compression) is not working with some special kind of files.

The source code has been compiled with xlc compiler.
# xlc -qversion
IBM XL C/C++ Enterprise Edition V8.0 for AIX
Version: 08.00.0000.0012

The issue has been seen on AIX 6.1.0.0, AIX 7.1.0.0, AIX 7.2.0.0.

You can recreate the issue in the following way :- 

# scp -C /usr/lib/libssl.a localhost:/
root@localhost's password:
libssl.a                              0%    0     0.0KB/s   --:-- ETA
ssh_packet_send: invalid format
lost connection

* Here i am using libssl.a library file as a special file. 
Also i am sending debug logs for both scp and sshd daemon.

Thanks 
Mayank Sharma
AIX Opensource Security, IBM.
Comment 1 Mayank Sharma 2018-01-17 17:56:26 AEDT
Hello Team
Is there any update on this defect ? Please let me know if any additional information is required.

Thanks 
Mayank Sharma
Comment 2 Darren Tucker 2018-01-17 18:14:00 AEDT
What configure and compile time options were used?  What version of zlib was used and what options was it compiled with?

The only thing I can think of that would manifest like this would be if zlib was built with some kind of leak/overflow checking that would cause it to pollute stdout or stderr.

Whatever is going on seems to be in the ssh process under the scp one on the client side.  If you attach an strace or similar to that process before it exits you might get a hint.

The other thing you could try is to compile with -DPACKET_DEBUG (but be aware this may expose some private info in the logs, so check it before sharing it).
Comment 3 Mayank Sharma 2018-04-26 20:51:43 AEST
Hi,

I have gone through the source code and compilation process and i found that this error occurred because of the old zlib libraries. I have now replaced the older with new zlib libraries and compiled. Its working fine now. Thanks team for your effort.
Comment 4 Damien Miller 2021-04-23 14:58:13 AEST
closing resolved bugs as of 8.6p1 release