From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 4/5] netfilter: x_tables: fix unconditional helper
Date: Thu, 24 Mar 2016 21:18:39 +0100 [thread overview]
Message-ID: <20160324201839.GD1937@salvia> (raw)
In-Reply-To: <1458666173-24318-5-git-send-email-fw@strlen.de>
On Tue, Mar 22, 2016 at 06:02:52PM +0100, Florian Westphal wrote:
> Ben Hawkes says:
>
> In the mark_source_chains function (net/ipv4/netfilter/ip_tables.c) it
> is possible for a user-supplied ipt_entry structure to have a large
> next_offset field. This field is not bounds checked prior to writing a
> counter value at the supplied offset.
>
> Problem is that mark_source_chains should not have been called --
> the rule doesn't have a next entry, so its supposed to return
> an absolute verdict of either ACCEPT or DROP.
>
> However, the function conditional() doesn't work as the name implies.
> It only checks that the rule is using wildcard address matching.
>
> However, an unconditional rule must also not be using any matches
> (no -m args).
>
> The underflow validator only checked the addresses, therefore
> passing the 'unconditional absolute verdict' test, while
> mark_source_chains also tested for presence of matches, and thus
> proceeeded to the next (not-existent) rule.
>
> Unify this so that all the callers have same idea of 'unconditional rule'.
Applied, thanks Florian.
next prev parent reply other threads:[~2016-03-24 20:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 17:02 [PATCH nf v3] netfilter: x_tables: perform more sanity tests on rule set Florian Westphal
2016-03-22 17:02 ` [PATCH 1/5] netfilter: x_tables: validate e->target_offset early Florian Westphal
2016-03-24 20:17 ` Pablo Neira Ayuso
2016-03-22 17:02 ` [PATCH 2/5] netfilter: x_tables: make sure e->next_offset covers remaining blob size Florian Westphal
2016-03-24 20:18 ` Pablo Neira Ayuso
2016-03-22 17:02 ` [PATCH 3/5] netfilter: x_tables: add and use xt_check_entry_target Florian Westphal
2016-03-24 20:18 ` Pablo Neira Ayuso
2016-03-25 11:45 ` Florian Westphal
2016-03-25 14:27 ` Pablo Neira Ayuso
2016-03-22 17:02 ` [PATCH 4/5] netfilter: x_tables: fix unconditional helper Florian Westphal
2016-03-24 20:18 ` Pablo Neira Ayuso [this message]
2016-03-22 17:02 ` [PATCH 5/5] netfilter: x_tables: don't move to non-existant next rule Florian Westphal
2016-03-22 17:22 ` Pablo Neira Ayuso
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=20160324201839.GD1937@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@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 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.