From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Liping Zhang <zlpnobody@163.com>
Cc: netfilter-devel@vger.kernel.org,
Liping Zhang <liping.zhang@spreadtrum.com>
Subject: Re: [PATCH nf-next] netfilter: nf_tables: check tprot_set first when we use xt.thoff
Date: Thu, 22 Sep 2016 17:26:13 +0200 [thread overview]
Message-ID: <20160922152613.GC17824@salvia> (raw)
In-Reply-To: <1474093880-21022-1-git-send-email-zlpnobody@163.com>
On Sat, Sep 17, 2016 at 02:31:20PM +0800, Liping Zhang wrote:
> From: Liping Zhang <liping.zhang@spreadtrum.com>
>
> pkt->xt.thoff is not always set properly, but we use it without any check.
> For payload expr, it will cause wrong results. For nftrace, we may notify
> the wrong network or transport header to the user space, furthermore,
> input the following nft rules, warning message will be printed out:
> # nft add rule arp filter output meta nftrace set 1
>
> WARNING: CPU: 0 PID: 13428 at net/netfilter/nf_tables_trace.c:263
> nft_trace_notify+0x4a3/0x5e0 [nf_tables]
> Call Trace:
> [<ffffffff813d58ae>] dump_stack+0x63/0x85
> [<ffffffff810a4c0b>] __warn+0xcb/0xf0
> [<ffffffff810a4d3d>] warn_slowpath_null+0x1d/0x20
> [<ffffffffa0589703>] nft_trace_notify+0x4a3/0x5e0 [nf_tables]
> [ ... ]
> [<ffffffffa05690a8>] nft_do_chain_arp+0x78/0x90 [nf_tables_arp]
> [<ffffffff816f4aa2>] nf_iterate+0x62/0x80
> [<ffffffff816f4b33>] nf_hook_slow+0x73/0xd0
> [<ffffffff81732bbf>] arp_xmit+0x8f/0xb0
> [ ... ]
> [<ffffffff81732d36>] arp_solicit+0x106/0x2c0
>
> So before we use pkt->xt.thoff, check the tprot_set first.
Applied, thanks a lot.
prev parent reply other threads:[~2016-09-22 15:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-17 6:31 [PATCH nf-next] netfilter: nf_tables: check tprot_set first when we use xt.thoff Liping Zhang
2016-09-22 15:26 ` Pablo Neira Ayuso [this message]
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=20160922152613.GC17824@salvia \
--to=pablo@netfilter.org \
--cc=liping.zhang@spreadtrum.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=zlpnobody@163.com \
/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;
as well as URLs for NNTP newsgroup(s).