From: David Miller <davem@davemloft.net>
To: dcaratti@redhat.com
Cc: vladbu@mellanox.com, xiyou.wangcong@gmail.com, jhs@mojatatu.com,
jiri@resnulli.us, netdev@vger.kernel.org
Subject: Re: [PATCH net] net/sched: act_ipt: fix refcount leak when replace fails
Date: Sun, 24 Feb 2019 17:31:13 -0800 (PST) [thread overview]
Message-ID: <20190224.173113.480240248994038722.davem@davemloft.net> (raw)
In-Reply-To: <9616212b5203dac35d55d67b25963487a8276191.1550834953.git.dcaratti@redhat.com>
From: Davide Caratti <dcaratti@redhat.com>
Date: Fri, 22 Feb 2019 12:33:25 +0100
> After commit 4e8ddd7f1758 ("net: sched: don't release reference on action
> overwrite"), the error path of all actions was converted to drop refcount
> also when the action was being overwritten. But we forgot act_ipt_init(),
> in case allocation of 'tname' was not successful:
>
> # tc action add action xt -j LOG --log-prefix hello index 100
> tablename: mangle hook: NF_IP_POST_ROUTING
> target: LOG level warning prefix "hello" index 100
> # tc action show action xt
> total acts 1
>
> action order 0: tablename: mangle hook: NF_IP_POST_ROUTING
> target LOG level warning prefix "hello"
> index 100 ref 1 bind 0
> # tc action replace action xt -j LOG --log-prefix world index 100
> tablename: mangle hook: NF_IP_POST_ROUTING
> target: LOG level warning prefix "world" index 100
> RTNETLINK answers: Cannot allocate memory
> We have an error talking to the kernel
> # tc action show action xt
> total acts 1
>
> action order 0: tablename: mangle hook: NF_IP_POST_ROUTING
> target LOG level warning prefix "hello"
> index 100 ref 2 bind 0
>
> Ensure we call tcf_idr_release(), in case 'tname' allocation failed, also
> when the action is being replaced.
>
> Fixes: 4e8ddd7f1758 ("net: sched: don't release reference on action overwrite")
> Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Applied and queued up for -stable.
prev parent reply other threads:[~2019-02-25 1:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 11:33 [PATCH net] net/sched: act_ipt: fix refcount leak when replace fails Davide Caratti
2019-02-25 1:31 ` David Miller [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=20190224.173113.480240248994038722.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=vladbu@mellanox.com \
--cc=xiyou.wangcong@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