From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
Cc: netdev@vger.kernel.org, kaber@trash.net, kadlec@blackhole.kfki.hu
Subject: Re: nft 2.0, NULL pointer dereference in 3.14.1
Date: Sun, 4 May 2014 13:33:57 +0200 [thread overview]
Message-ID: <20140504113357.GA3953@localhost> (raw)
In-Reply-To: <3a97c044d7e99dc4bd3d6b8d36d79a01@visp.net.lb>
On Sun, May 04, 2014 at 10:25:58AM +0300, Denys Fedoryshchenko wrote:
> Hi
>
> I bit more debugging and found that problem is happening at:
>
> >sock = netlink_lookup(sock_net(ssk), ssk->sk_protocol, portid);
>
> ssk is NULL
>
> After checking, i noticed in nfnetlink.c
> nfnetlink_rcv_batch() function
>
> We have
> nskb->sk = oskb->sk;
> skb = nskb;
>
> I am matching condition
> ss = rcu_dereference_protected(table[subsys_id].subsys,
> lockdep_is_held(&table[subsys_id].mutex));
> if (!ss) {
>
> And then
> nfnl_unlock(subsys_id);
> kfree_skb(nskb);
> return netlink_ack(skb, nlh, -EOPNOTSUPP);
>
> If i am not wrong, nskb same pointer as skb, so we are giving
> netlink_ack freed pointer?
> Is it "use after free()" ?
Right, this is an embarrasing use after free when no nf_tables support
has been selected / modules are not available.
> If yes, then it seems attached patch fixing my issue. Please let me
> know, if it is ok and i should submit it.
I'm going to take this, but please next time use git format-patch and
include your Signed-off-by tag. If you feel the patch is not complete
in some aspect or that you may be missing anything, just include the
RFC tag in the subject.
Thanks Denys!
next prev parent reply other threads:[~2014-05-04 11:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-19 7:36 nft 2.0, NULL pointer dereference in 3.14.1 Denys Fedoryshchenko
2014-05-04 7:25 ` Denys Fedoryshchenko
2014-05-04 11:33 ` Pablo Neira Ayuso [this message]
2014-05-04 17:32 ` Denys Fedoryshchenko
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=20140504113357.GA3953@localhost \
--to=pablo@netfilter.org \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=netdev@vger.kernel.org \
--cc=nuclearcat@nuclearcat.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).