Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 98726 (tcpserver_limits) - ucspi-tcp tcpserver: limits patch
Summary: ucspi-tcp tcpserver: limits patch
Status: RESOLVED WONTFIX
Alias: tcpserver_limits
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Low enhancement (vote)
Assignee: Qmail Team (OBSOLETE)
URL: http://linux.voyager.hr/ucspi-tcp/
Whiteboard:
Keywords:
: 148584 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-11 19:25 UTC by Fred Dinkler IV
Modified: 2007-02-01 08:04 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The limits patch (tcpserver-limits-2005-01-30.diff,12.68 KB, patch)
2005-07-11 19:30 UTC, Fred Dinkler IV
Details | Diff
ipv6 patch for limits (0.88-limits-ipv6.patch,1.50 KB, patch)
2006-01-12 04:49 UTC, Manuel Mausz
Details | Diff
ipv6 patch for limits (0.88-limits-ipv6.patch,1.50 KB, patch)
2006-01-12 16:19 UTC, Manuel Mausz
Details | Diff
ucspi-tcp-0.88-r16.ebuild (ucspi-tcp-0.88-r16.ebuild,3.11 KB, text/plain)
2006-09-12 10:42 UTC, Manuel Mausz
Details
ucspi-tcp-0.88-r17.ebuild (ucspi-tcp-0.88-r17.ebuild,3.12 KB, patch)
2006-11-14 14:54 UTC, Manuel Mausz
Details | Diff
SSL support, Limit support with correct download links (ucspi-tcp-0.88-r18.ebuild,3.35 KB, text/plain)
2007-01-31 21:15 UTC, tomas charvat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Dinkler IV 2005-07-11 19:25:11 UTC
the tcpserver program allows a max number of connections (default 40). It does not allow for a maximum per ip address. This patch allows for that. Without this patch, tcpserver is highly suseptable to very basic DOS attacks.

This is for the ucspi-tcp ebuild, tcpserver program.
Comment 1 Fred Dinkler IV 2005-07-11 19:30:29 UTC
Created attachment 63193 [details, diff]
The limits patch

This is the limits patch, should work on 64bit machines as well as linux-like
enviroments (mac psx, ect)
Comment 2 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-08-27 07:35:09 UTC
ucspi-tcp belongs to base-system
Comment 3 SpanKY gentoo-dev 2005-08-27 11:54:18 UTC
yes, but qmail herd has been taking care of it due to the heavy qmail/ucspi-tcp
integration
Comment 4 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-08-28 05:42:15 UTC
I've bumped the package to -r11 and added that patch. For the next time, please
provide one that applies directly and doesn't need rediffing. Can you test it,
please?
Comment 5 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-09-17 11:38:35 UTC
No response, closing.
Comment 6 Fred Dinkler 2005-10-03 10:42:14 UTC
(In reply to comment #5)
> No response, closing.

Gah... got lost in e-mail shuffle, plz re-open and I will test.
Comment 7 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-10-03 11:55:34 UTC
I think you should have been able to do that yourself, anyway, reopened.
Comment 8 Manuel Mausz 2006-01-11 16:38:46 UTC
This patch doesn't work when compiled with ipv6 support. It will only allow total connections up to MAXCONNIP (or MAXCONNC) since it doesn't copy the remoteip correctly for ipv6.

Making the patch ipv6-ready should be quite simple.
Comment 9 Manuel Mausz 2006-01-12 04:49:10 UTC
Created attachment 76896 [details, diff]
ipv6 patch for limits

Adds ipv6 compatibility to limits patch. Should be applied after limits patch and of course only if compiled with ipv6.
Comment 10 Manuel Mausz 2006-01-12 16:16:54 UTC
Comment on attachment 76896 [details, diff]
ipv6 patch for limits

bugged patch
Comment 11 Manuel Mausz 2006-01-12 16:19:32 UTC
Created attachment 76956 [details, diff]
ipv6 patch for limits

Adds ipv6 compatibility to limits patch. Should be applied after limits patch
and of course only if compiled with ipv6.

accidentally mixed ipv4 and ipv6 subnet code
Comment 12 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2006-03-12 10:34:02 UTC
Due to an updated ssl patch, the limit patch(es) don't apply anymore. Can you please submit new patches for ucspi-tcp-0.88-r14?
Comment 13 Manuel Mausz 2006-03-12 17:52:54 UTC
(In reply to comment #12)
> Due to an updated ssl patch, the limit patch(es) don't apply anymore. Can you
> please submit new patches for ucspi-tcp-0.88-r14?
> 

Supplying new patches shouldn't be a problem but actually your rediffed patch "ucspi-tcp-0.88-ipv6-ssl-20050405.patch" won't work (and possibly crash).

Snipped:
...
+struct conn {
+  int pid;
+  char remoteip[4];
+} *conns;
...

char[4] for ipv6?
Comment 14 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2006-03-14 11:12:43 UTC
revision 1.2
date: 2006-03-14 20:06:46 +0100;  author: hansmi;  state: Exp;  lines: +8 -2;  commitid: 15df441714454567;
Disabled the rediffed patch, it's broken. Put an ewarn there instead.

I think that's better, then. Thanks. I currently don't have enough time and motivation to work this IPv6 stuff out.
Comment 15 Manuel Mausz 2006-09-12 10:42:10 UTC
Created attachment 96809 [details]
ucspi-tcp-0.88-r16.ebuild

Ok guys.

I've created a new ebuild for ucspi-tcp which includes my new ssl-, ipv6- and limits-patches. All possible combinations are covered and working (tested on x86).

Please note that I've removed the limit features (parameter -C and -e) of the origin ssl patch, since its a feature which is already covered by the limits patch.
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2006-09-21 19:47:45 UTC
*** Bug 148584 has been marked as a duplicate of this bug. ***
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2006-09-21 19:48:21 UTC
Reopen.
Comment 18 Manuel Mausz 2006-11-14 14:54:25 UTC
Created attachment 101953 [details, diff]
ucspi-tcp-0.88-r17.ebuild

Found a bug in my rediffed and slightly reorganized limits patch and fixed it. The bug causes the limits defined in the cdb file not to work. The new ebuild (r17) already includes the fixed patch.
Comment 19 Justin Carlson 2006-11-20 05:51:39 UTC
I work at an ISP were we have implemented this patch and can say that for the last week it has been running flawlessly.  This type of functionality SHOULD have been in the package since it's begining.  PLEASE PLEASE make this part of the standard gentoo ebuild in portgage as others would benefit from this greatly.  Thank you!
Comment 20 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2006-11-20 06:03:01 UTC
there is also ipsvd, which AFAICT has all of tcpservers functionality, but without any patching... ymmv

it's not in portage (yet) unfortunately ... see bug #76522
Comment 21 Manuel Mausz 2006-11-20 08:24:26 UTC
(In reply to comment #20)
afaik ipsvd doesn't support limits based on cpu load
Comment 22 Justin Carlson 2006-12-08 12:58:10 UTC
still running flawless now on all filter machines.  Any chance of this making it into portage? please with sugar on top?
Comment 23 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-01-23 19:31:35 UTC
I won't add custom patches to ucspi-tcp anymore. Sorry about that. Please use UCSPI_TCP_PATCH_DIR.
Comment 24 tomas charvat 2007-01-31 13:05:28 UTC
(In reply to comment #23)
> I won't add custom patches to ucspi-tcp anymore. Sorry about that. Please use
> UCSPI_TCP_PATCH_DIR.
> 

It doesn work, there is some issue with the other patch.
I tried r17, but it cant even download these patchs.

Is there any chance to get working Limit patch in ucspi ?

Comment 25 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-01-31 14:48:15 UTC
(In reply to comment #24)
> It doesn work, there is some issue with the other patch.

Please be more specific.

> I tried r17, but it cant even download these patchs.

There's no r17 for ucspi-tcp.
Comment 26 tomas charvat 2007-01-31 20:54:08 UTC
(In reply to comment #25)

> Please be more specific.
http://manuel.mausz.at/programming/patches/ucspi-tcp/ucspi-tcp-ssl-20050405-mm.patch
doesnt exist.

> 
> There's no r17 for ucspi-tcp.
There is r17 patch upthere in this bug report.
I found r18, at Manuel's webpage. i manage to fix download paths in -r18 from his web page and it compile w/o problem and then it also work. Im testing it on server which accept approx 4 smtp connections per second.

I will try to create attachment and add it.

Comment 27 tomas charvat 2007-01-31 21:15:36 UTC
Created attachment 108790 [details]
SSL support, Limit support with correct download links

This ebuild has been created by Manuel Mausz, i just found it at his web (lol) and corrected some download links. It compiled w/o problem on x32 and amd64. Con. limit and Load limit are both working. However more testers are welcome.
It runs well for several hours on 2 servers (x32 and amd64) with out any problem.
This also include some ssp support, but it hasnt been tested by me.
Comment 28 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-02-01 08:04:41 UTC
(In reply to comment #26)
> There is r17 patch upthere in this bug report.

That doesn't matter, sorry. The only relevant source I'm talking about is the official portage tree.

> http://manuel.mausz.at/programming/patches/ucspi-tcp/ucspi-tcp-ssl-20050405-mm.patch
> doesnt exist.

In that case, I'd have to bump the old ebuild again. Instead, I'm going to mark ucspi-tcp-0.88-r16 stable soon™. Can you please try with it?