From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Liping Zhang <zlpnobody@163.com>
Cc: netfilter-devel@vger.kernel.org, Liping Zhang <zlpnobody@gmail.com>
Subject: Re: [PATCH nf V2 2/2] netfilter: nfnl_cthelper: reject del request if helper obj is in use
Date: Mon, 15 May 2017 18:37:28 +0200 [thread overview]
Message-ID: <20170515163728.GC3863@salvia> (raw)
In-Reply-To: <20170507140156.16487-3-zlpnobody@163.com>
On Sun, May 07, 2017 at 10:01:56PM +0800, Liping Zhang wrote:
> From: Liping Zhang <zlpnobody@gmail.com>
>
> We can still delete the ct helper even if it is in use, this will cause
> a use-after-free error. In more detail, I mean:
> # nfct helper add ssdp inet udp
> # iptables -t raw -A OUTPUT -p udp -j CT --helper ssdp
> # nfct helper delete ssdp //--> oops, succeed!
> BUG: unable to handle kernel paging request at 000026ca
> IP: 0x26ca
> [...]
> Call Trace:
> ? ipv4_helper+0x62/0x80 [nf_conntrack_ipv4]
> nf_hook_slow+0x21/0xb0
> ip_output+0xe9/0x100
> ? ip_fragment.constprop.54+0xc0/0xc0
> ip_local_out+0x33/0x40
> ip_send_skb+0x16/0x80
> udp_send_skb+0x84/0x240
> udp_sendmsg+0x35d/0xa50
>
> So add reference count to fix this issue, if ct helper is used by
> others, reject the delete request.
>
> Apply this patch:
> # nfct helper delete ssdp
> nfct v1.4.3: netlink error: Device or resource busy
Applied, thanks.
prev parent reply other threads:[~2017-05-15 16:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-07 14:01 [PATCH nf V2 0/2] netfilter: reject cthelper del request if it is in use Liping Zhang
2017-05-07 14:01 ` [PATCH nf V2 1/2] netfilter: introduce nf_conntrack_helper_put helper function Liping Zhang
2017-05-15 16:37 ` Pablo Neira Ayuso
2017-05-07 14:01 ` [PATCH nf V2 2/2] netfilter: nfnl_cthelper: reject del request if helper obj is in use Liping Zhang
2017-05-15 16:37 ` 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=20170515163728.GC3863@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=zlpnobody@163.com \
--cc=zlpnobody@gmail.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).