From: Patrick McHardy <kaber@trash.net>
To: Wayne Schroeder <raz@positivenetworks.net>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: What basic sanity checking on packet headers is done
Date: Fri, 29 Sep 2006 18:50:01 +0200 [thread overview]
Message-ID: <451D4EB9.2020905@trash.net> (raw)
In-Reply-To: <451D47E5.7000108@positivenetworks.net>
Wayne Schroeder wrote:
> I've written a new target module that uses the ip header fields of ihl
> and tot_len for offsets into the packets. How safe is the data in the
> ip headers? Is there sanity checking when the packet is received off
> the wire... for instance -- is it safe to assume in the prerouting chain
> of the mangle table that tot_len will not put me past the memory
> allocated for the packet? Same goes for ihl?
Check out ip_rcv() in ip_input.c. ihl and tot_len are _usually_ valid
within netfilter. The only exception is raw sockets, on the outgoing
hooks the only guarantee is that ihl * 4 >= sizeof(struct iphdr) (
only for ip_tables, see iptable_filter.c). We could consider providing
stricter guarantees, I'm pretty sure some modules only perform
insufficient checks.
next prev parent reply other threads:[~2006-09-29 16:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-29 16:20 What basic sanity checking on packet headers is done Wayne Schroeder
2006-09-29 16:50 ` Patrick McHardy [this message]
2006-09-29 16:59 ` Wayne Schroeder
2006-09-29 17:14 ` Patrick McHardy
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=451D4EB9.2020905@trash.net \
--to=kaber@trash.net \
--cc=netfilter-devel@lists.netfilter.org \
--cc=raz@positivenetworks.net \
/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.