Bug 47763 - patch: if server sends RST after connecting, ncftp segfaults
patch: if server sends RST after connecting, ncftp segfaults
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: ncftp (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-06 17:44 EDT by Pekka Savola
Modified: 2007-04-18 12:34 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-07 03:11:14 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)
fix a segfault when performing freeaddrinfo twice (500 bytes, patch)
2001-07-06 17:45 EDT, Pekka Savola
no flags Details | Diff

  None (edit)
Description Pekka Savola 2001-07-06 17:44:21 EDT
ncftp 3.0.2 + ipv6 patch segfaults (same also with ncftp 3.0.3, but signal
handling in 3.0.3 is very, very broken IMO) if server, or some party sends
RST right after connecting:

bash-2.05# ncftp aaa.bbb.14.50
NcFTP 3.0.2 (October 19, 2000) by Mike Gleason (ncftp@ncftp.com).
14:13:35.625741 xxx.yyy.2.51.1394 > aaa.bbb.14.50.ftp: S 2791266803:2791266803(0) win 5840 <mss 1460,sackOK,timestamp 
598170590,nop,wscale 0> (DF)
14:13:35.735736 aaa.bbb.14.50.ftp > xxx.yyy.2.51.1394: S 331434369:331434369(0) ack
2791266804 win 32120 <mss 1460,sackOK,timestamp 316270647 59817059,nop,wscale 0> (DF)
14:13:35.735736 xxx.yyy.2.51.1394 > aaa.bbb.14.50.ftp: . ack 1 win 5840 <nop,nop,timestamp 59817070 316270647> (DF)
14:13:35.855732 aaa.bbb.14.50.ftp > xxx.yyy.2.51.1394: R 331434370:331434370(0) win 0 (DF)
Remote host has closed the connection.
Segmentation fault (core dumped)

With my patch (or without ipv6 enabled):

bash-2.05# ./ncftp ftp.openbsd.org
NcFTP 3.0.2 (October 19, 2000) by Mike Gleason (ncftp@ncftp.com).
Remote host has closed the connection.
Sleeping 19 seconds...

Without my patch:

bash-2.05# ncftp ftp.openbsd.org
NcFTP 3.0.2 (October 19, 2000) by Mike Gleason (ncftp@ncftp.com).
Remote host has closed the connection.
Segmentation fault (core dumped)
Comment 1 Pekka Savola 2001-07-06 17:45:44 EDT
Created attachment 22911 [details]
fix a segfault when performing freeaddrinfo twice
Comment 2 Pekka Savola 2001-07-07 03:11:11 EDT
FWIW, this is also fixed in the latest patch at ftp.kame.net.
Comment 3 Bernhard Rosenkraenzer 2001-07-19 08:11:44 EDT
Thanks, fixed in 3.0.3-3
Comment 4 Pekka Savola 2001-07-21 03:56:17 EDT
In changelog, you put:

- Fix ipv6 crash (Patch from Pekka Savola, #47763)

Depending on the definition of "ipv6 crash", this might not be 100% pedantic ;-), as it happens 
when connecting to IPv4 sites too _if_ IPv6 has been enabled (ie: getaddrinfo() is used for
address resolution).

Not that it matters ;-)

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