From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: kadlec@blackhole.kfki.hu, fw@strlen.de, davem@davemloft.net,
adobriyan@gmail.com, akpm@linux-foundation.org,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] netfilter: fix missed NULL check in nf_conntrack_proto_pernet_init()
Date: Thu, 13 Dec 2018 00:26:48 +0100 [thread overview]
Message-ID: <20181212232648.qsvyuc3g2jj5v2ej@salvia> (raw)
In-Reply-To: <1544014590-14429-4-git-send-email-laoar.shao@gmail.com>
On Wed, Dec 05, 2018 at 08:56:29PM +0800, Yafang Shao wrote:
> nf_ct_l4proto_net() may return NULL.
> That may happens if some module forget to set both l4proto->get_net_proto
> and l4proto->net_id.
> We'd check the return value here, in case crash happens.
>
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
> net/netfilter/nf_conntrack_proto.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
> index 154e8c0..316fef3 100644
> --- a/net/netfilter/nf_conntrack_proto.c
> +++ b/net/netfilter/nf_conntrack_proto.c
> @@ -946,6 +946,9 @@ int nf_conntrack_proto_pernet_init(struct net *net)
> struct nf_proto_net *pn = nf_ct_l4proto_net(net,
> &nf_conntrack_l4proto_generic);
There is another spot missing in this file that is missing the check
for NULL.
We can probably simplify all this is we place the gre conntracker in
the conntrack core, as it's been suggested already. It's the only one
remaining as a module and it now supports for IPv6, so it's probably
better follow that path.
next prev parent reply other threads:[~2018-12-12 23:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 12:56 [PATCH 1/5] netfilter: fix general protection fault when unregister sysctl table Yafang Shao
2018-12-05 12:56 ` [PATCH 2/5] netfilter: register sysctl table for gre Yafang Shao
2018-12-05 12:56 ` [PATCH 3/5] procfs: fix double drop_sysctl_table() Yafang Shao
2018-12-05 12:56 ` [PATCH 4/5] netfilter: fix missed NULL check in nf_conntrack_proto_pernet_init() Yafang Shao
2018-12-12 23:26 ` Pablo Neira Ayuso [this message]
2018-12-13 9:50 ` Yafang Shao
2018-12-05 12:56 ` [PATCH 5/5] netfilter: fix error return value of nf_ct_l4proto_pernet_register_one() Yafang Shao
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=20181212232648.qsvyuc3g2jj5v2ej@salvia \
--to=pablo@netfilter.org \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=kadlec@blackhole.kfki.hu \
--cc=laoar.shao@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®