public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Denenberg <adam@dberg.org>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: bind() udp behavior 2.6.8.1
Date: Tue, 14 Dec 2004 12:38:02 -0500	[thread overview]
Message-ID: <1103045881.10965.48.camel@sucka> (raw)
In-Reply-To: <Pine.LNX.4.61.0412141806440.5600@yvahk01.tjqt.qr>

i am aware that UDP is connectionless.  However in terms of a firewall
this is different.  It _must_ keep a state table of some sorts otherwise
high port outbound connections destined for a DNS server will never be
let back in b/c the firewall will just say "Why is this dns server
making a udp connection to port 32768 on this client?".  Keeping a state
table allows this behavior thru the firewall as it should.

My issue is that linux is not randomizing or incrementing the ports it
uses for udp connections to prevent this sort of issue since udp is
connectionless.  We dont have sequence numbers or the sorts like TCP to
sort this out, we only have source ip and port.

Other OS's seem  to do this and thus apps are not getting broken when
connections are made thru the firewall, which is why i originally posted
the question.  I was hoping that maybe there is some workaround or that
hopefully someone else encountered this issue.  I am not saying the
firewall is not totally to blame, but i can see why it is behaving the
way it is when seeing tons of connections from the same udp ip/port come
in.

thanks again
adam



On Tue, 2004-12-14 at 12:10, Jan Engelhardt wrote:
> >any firewall must keep some sort of state table even if it is udp.  How
> 
> No.
> 
> >else do you manage established connections?  It must know that some high
> 
> You don't manage something that does not need managing. It's like firing a 
> bullet at some. You can not tell whether there's still more bullets to come or 
> not.
> 
> >numbered port is making a udp dns request, and thus be able to allow
> >that request back thru to the high numbered port client b/c the
> >connection is already established.
> 
> See linux-os's reply. UDP is connectionless.
> 
> >what does any fireawall do if it sees one ip with the same high numbered
> >udp port make a request in a _very_ short amount of time (under 60ms for
> >this example)?
> 
> I let it pass.
> 
> >It must make a distintion between an attack and legit
> >traffic.
> 
> That's something VERY different. There is a difference between **knowing** 
> that a set of packets _are related_ to each other and the time between two 
> **arbitrary** packets.
> 
> >  So if it sees one ip/port make multiple requests in too short
> >of a time frame, it will drop the traffic, as it probably should.
> 
> Depends on the definition of attack. Look it at that way:
> 
> localhost:32768 sends an UDP packet to dnsserver:53... but already the next 
> packet CAN BE malicious. (Another process can take over the port if the former 
> has dropped the socket.)
> 
> >This
> >is causing erratic behavior when traffic traverses the firewall b/c the
> 
> Then fix the FW.
> 
> >linux kernel keeps allocating the same source high numbered ephemeral
> 
> In your case, the socket is allocated once for the whole program. This socket 
> is _reused_.
> 
> >port.  I would like to know if there is a way to alter this behavior b/c
> >it is breaking applications.
> 
> No, as said, your FW is broken.
> 
> 
> 
> 
> Jan Engelhardt


  reply	other threads:[~2004-12-14 17:40 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14 15:38 bind() udp behavior 2.6.8.1 Adam Denenberg
2004-12-14 16:04 ` Jan Engelhardt
2004-12-14 16:42   ` Adam Denenberg
2004-12-14 16:44     ` Jan Engelhardt
2004-12-14 17:01       ` Adam Denenberg
2004-12-14 17:10         ` Jan Engelhardt
2004-12-14 17:38           ` Adam Denenberg [this message]
2004-12-14 17:49             ` Jan Engelhardt
2004-12-15  0:43             ` Wichert Akkerman
2004-12-16  5:49             ` Willy Tarreau
2004-12-14 22:07         ` Kyle Moffett
2004-12-15  2:23           ` Adam Denenberg
2004-12-15  3:19             ` Kyle Moffett
2004-12-15 14:16               ` Adam Denenberg
2004-12-15 19:07                 ` Jan Harkes
2004-12-15 19:22                   ` Adam Denenberg
2004-12-15 20:06                     ` linux-os
2004-12-15 20:19                       ` Adam Denenberg
2004-12-15 20:45                         ` Doug McNaught
2004-12-15 20:48                           ` Adam Denenberg
2004-12-15 20:57                             ` Doug McNaught
2004-12-16  6:10                     ` Willy Tarreau
2004-12-16 14:24                   ` Adam Denenberg
2004-12-16 14:51                     ` Jan Harkes
2004-12-16 15:00                       ` Adam Denenberg
2004-12-16  6:03             ` Willy Tarreau
2004-12-16 14:17               ` Adam Denenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1103045881.10965.48.camel@sucka \
    --to=adam@dberg.org \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox