Bug 253509 - ftp-proxy not handling connections
Summary: ftp-proxy not handling connections
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.0-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-14 14:32 UTC by Daniel Ponte
Modified: 2021-09-27 12:05 UTC (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ponte 2021-02-14 14:32:44 UTC
stable/13-n244514-18097ee2fb7c

After updating to 13-STABLE from 12-STABLE, ftp-proxy no longer appears to function. Running it manually with -d -D7, it only prints its "listening" message and never anything else. Running it in ktrace only shows periodic kevent() calls and nothing else when a connection is made:

[...]
 57897 ftp-proxy GIO   fd 2 wrote 33 bytes
       "listening on 127.0.0.1 port 8021
       "
 57897 ftp-proxy RET   write 33/0x21
 57897 ftp-proxy CALL  kevent(0x5,0x800a4d000,0,0x800a4c000,0x40,0x7fffffffe690)
 57897 ftp-proxy STRU  struct kevent[] = {  }
 57897 ftp-proxy STRU  struct kevent[] = {  }
 57897 ftp-proxy RET   kevent 0
 57897 ftp-proxy CALL  kevent(0x5,0x800a4d000,0,0x800a4c000,0x40,0x7fffffffe690)
 57897 ftp-proxy STRU  struct kevent[] = {  }


It is definitely actually listening, and pf configured correctly to rdr to it, as stopping the service closes client connections.
Comment 1 Daniel Ponte 2021-02-14 16:20:06 UTC
Recompiling ftp-proxy linked instead to ports libevent (not libprivateevent1) resolves the issue on 13. The issue is contrib/pf/libevent/.
Comment 2 Hauke Fath 2021-05-17 16:05:17 UTC
Problem confirmed - coming from 11.1 to 13.0.

An ftp-proxy linked to pkgsrc libevent (the machine does not use ports) works fine.

Is there a perspective for a fix?
Comment 3 gergely.czuczy 2021-09-27 08:44:42 UTC
Hello,

A friend of mine also has a system which is affected by this bug. Could we please have this fixed?
Comment 4 Kristof Provost freebsd_committer 2021-09-27 11:40:19 UTC
THat's odd, because the regression test for it keeps passing. Kyle was the last person to touch pf's libevent, so absent further evidence I'm just going to blame everything on him.
Comment 5 gergely.czuczy 2021-09-27 11:43:29 UTC
Here're the host's details:
czuczy@harley:~ $ uname -a
FreeBSD harley.xyzones.net 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
czuczy@harley:~ $ uname -UK
1300139 1300139

The guys just tried to run an update, but it hasn't fixed it.

Are there any more details that I can share to identify what's wrong here?

When I ktraced it, the result was exactly what Daniel Ponte said. The kevent() calls weren't returning the new connections, as they should have.
Comment 6 Kamigishi Rei 2021-09-27 11:52:55 UTC
(In reply to gergely.czuczy from comment #5)

I do not think the fix is present in binary updates for 13.0; I may be mistaken but I have not noticed the update process p4 install anything related to ftp-proxy (I also use ftp-proxy, and it is similarly broken for me).
Comment 7 Kamigishi Rei 2021-09-27 12:05:22 UTC
(In reply to gergely.czuczy from comment #5)

Just checked my /var/db/freebsd-update on 13.0-RELEASE-p4 and could not find any matches for either ftp-proxy or libprivateevent. As it is not a security issue, we may possibly have to wait until 13.1 for the fix.

(Also, in my reply above, read ‘process p4’ as ‘process for p4’)