From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Joe Stringer <joestringer@nicira.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Patrick McHardy <kaber@trash.net>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
"David S. Miller" <davem@davemloft.net>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
Linux Netdev List <netdev@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [patch -master] netfilter: xt_CT: checking for IS_ERR() instead of NULL
Date: Mon, 03 Aug 2015 20:24:06 +0000 [thread overview]
Message-ID: <20150803202406.GA3339@salvia> (raw)
In-Reply-To: <CANr6G5z7B1T0VCMQ1cVCpiDwJvOTNMfh0L3j6pDNVNHhmShAng@mail.gmail.com>
On Mon, Aug 03, 2015 at 11:30:16AM -0700, Joe Stringer wrote:
> On 3 August 2015 at 11:29, Joe Stringer <joestringer@nicira.com> wrote:
> > On 30 July 2015 at 04:57, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> >> On Tue, Jul 28, 2015 at 01:42:28AM +0300, Dan Carpenter wrote:
> >>> We recently changed this from nf_conntrack_alloc() to nf_ct_tmpl_alloc()
> >>> so the error handling needs to changed to check for NULL instead of
> >>> IS_ERR().
> >>>
> >>> Fixes: 0838aa7fcfcd ('netfilter: fix netns dependencies with conntrack templates')
> >>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >>
> >> Applied, thanks.
> >>
> >> I have also appended this chunk, since synproxy is also affected:
> >>
> >> --- a/net/netfilter/nf_synproxy_core.c
> >> +++ b/net/netfilter/nf_synproxy_core.c
> >> @@ -353,7 +353,7 @@ static int __net_init synproxy_net_init(struct net *net)
> >> int err = -ENOMEM;
> >>
> >> ct = nf_ct_tmpl_alloc(net, 0, GFP_KERNEL);
> >> - if (IS_ERR(ct)) {
> >> + if (!ct) {
> >> err = PTR_ERR(ct);
> >> goto err1;
> >> }
> >
> > Does PTR_ERR() implicitly interpret NULL as -ENOMEM? Seems like the
> > fix applied here is a little different from the xt_CT fix.
>
> Just saw the initialization of err now, but this would be overridden
> within the error checking statement.
Right, I noticed before pushing out this change, the final applied
patch is here:
http://git.kernel.org/cgit/linux/kernel/git/pablo/nf.git/commit/?id\x1a727c63612fc582370cf3dc01239d3d239743b5
Let me know if you still have any concern, thanks Joe.
WARNING: multiple messages have this Message-ID (diff)
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Joe Stringer <joestringer@nicira.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Patrick McHardy <kaber@trash.net>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
"David S. Miller" <davem@davemloft.net>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
Linux Netdev List <netdev@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [patch -master] netfilter: xt_CT: checking for IS_ERR() instead of NULL
Date: Mon, 3 Aug 2015 22:24:06 +0200 [thread overview]
Message-ID: <20150803202406.GA3339@salvia> (raw)
In-Reply-To: <CANr6G5z7B1T0VCMQ1cVCpiDwJvOTNMfh0L3j6pDNVNHhmShAng@mail.gmail.com>
On Mon, Aug 03, 2015 at 11:30:16AM -0700, Joe Stringer wrote:
> On 3 August 2015 at 11:29, Joe Stringer <joestringer@nicira.com> wrote:
> > On 30 July 2015 at 04:57, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> >> On Tue, Jul 28, 2015 at 01:42:28AM +0300, Dan Carpenter wrote:
> >>> We recently changed this from nf_conntrack_alloc() to nf_ct_tmpl_alloc()
> >>> so the error handling needs to changed to check for NULL instead of
> >>> IS_ERR().
> >>>
> >>> Fixes: 0838aa7fcfcd ('netfilter: fix netns dependencies with conntrack templates')
> >>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >>
> >> Applied, thanks.
> >>
> >> I have also appended this chunk, since synproxy is also affected:
> >>
> >> --- a/net/netfilter/nf_synproxy_core.c
> >> +++ b/net/netfilter/nf_synproxy_core.c
> >> @@ -353,7 +353,7 @@ static int __net_init synproxy_net_init(struct net *net)
> >> int err = -ENOMEM;
> >>
> >> ct = nf_ct_tmpl_alloc(net, 0, GFP_KERNEL);
> >> - if (IS_ERR(ct)) {
> >> + if (!ct) {
> >> err = PTR_ERR(ct);
> >> goto err1;
> >> }
> >
> > Does PTR_ERR() implicitly interpret NULL as -ENOMEM? Seems like the
> > fix applied here is a little different from the xt_CT fix.
>
> Just saw the initialization of err now, but this would be overridden
> within the error checking statement.
Right, I noticed before pushing out this change, the final applied
patch is here:
http://git.kernel.org/cgit/linux/kernel/git/pablo/nf.git/commit/?id=1a727c63612fc582370cf3dc01239d3d239743b5
Let me know if you still have any concern, thanks Joe.
next prev parent reply other threads:[~2015-08-03 20:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 22:42 [patch -master] netfilter: xt_CT: checking for IS_ERR() instead of NULL Dan Carpenter
2015-07-27 22:42 ` Dan Carpenter
2015-07-30 11:57 ` Pablo Neira Ayuso
2015-07-30 11:57 ` Pablo Neira Ayuso
2015-07-30 12:01 ` Dan Carpenter
2015-07-30 12:01 ` Dan Carpenter
2015-07-30 12:26 ` Pablo Neira Ayuso
2015-07-30 12:26 ` Pablo Neira Ayuso
2015-08-03 18:29 ` Joe Stringer
2015-08-03 18:29 ` Joe Stringer
2015-08-03 18:30 ` Joe Stringer
2015-08-03 18:30 ` Joe Stringer
2015-08-03 20:24 ` Pablo Neira Ayuso [this message]
2015-08-03 20:24 ` Pablo Neira Ayuso
2015-08-03 20:34 ` Joe Stringer
2015-08-03 20:34 ` Joe Stringer
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=20150803202406.GA3339@salvia \
--to=pablo@netfilter.org \
--cc=coreteam@netfilter.org \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=joestringer@nicira.com \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=kernel-janitors@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 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.