All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Craig <philipc@snapgear.com>
To: netfilter-devel@lists.netfilter.org
Subject: tcp match silently drops packets
Date: Mon, 10 Oct 2005 13:01:14 +1000	[thread overview]
Message-ID: <4349D97A.9070708@snapgear.com> (raw)

If you send a 20 byte IP packet that has the protocol set to 6,
(ie TCP packet with no TCP header) then the following rule will match:

iptables -I FORWARD -p tcp

and the following rule will match and silently drop the packet:

iptables -I FORWARD -p tcp --syn

I think the behaviour of the first rule is fine, but the second one
should simply not match.  These packets probably should be dropped,
but this is a policy decision, and shouldn't be implemented in the
tcp match.  And if it must drop it, then a log message or counter
somewhere would be nice.

Conntracking marks the packet as INVALID, so you can use that to
drop it, and also log it if desired.

This isn't a big issue for me.  I had a TCPMSS rule before the INVALID
check, so I just need to reorder that.

There is a similar issue in TCPMSS itself: it has a few tests
that drop the packet.  In particular, it drops TCP SYN packets that
contain data.  Since TCPMSS isn't a firewall match (it is a hack to
try to avoid dropped packets), I don't think it makes sense for
it to drop packets that it can't handle.  I can submit a patch for
this if needed.

(Note: I tested this on 2.4.31.  There was some change to the tcp
hotdrop code as part of the skb linearization in 2.6, but from
reading the code, the behaviour looks the same.)

             reply	other threads:[~2005-10-10  3:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-10  3:01 Philip Craig [this message]
2005-10-16  7:51 ` tcp match silently drops packets Yasuyuki KOZAKAI
2005-10-16 17:35   ` Henrik Nordstrom
2005-10-16 21:07     ` Henrik Nordstrom
2005-10-16 21:50       ` Herbert Xu
2005-10-17 19:30         ` Henrik Nordstrom
2005-10-17 21:27           ` Herbert Xu
2005-10-17 21:52             ` Henrik Nordstrom
2005-10-17  0:21       ` Philip Craig
2005-10-17 13:35         ` Henrik Nordstrom
2005-10-17 13:47       ` JC
2005-10-17 13:52         ` Henrik Nordstrom
2005-10-17 13:57           ` JC
2005-10-17 13:59             ` Henrik Nordstrom
2005-10-17 14:03               ` JC
2005-10-17 14:01           ` Cedric Blancher
2005-10-18  2:11           ` Herbert Xu
2005-10-18  8:31             ` Henrik Nordstrom
2005-10-17  0:18     ` Philip Craig

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=4349D97A.9070708@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.