netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: mrv@mojatatu.com
Cc: netdev@vger.kernel.org, kernel@mojatatu.com, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, jiri@resnulli.us
Subject: Re: [PATCH net 1/1] net sched actions: fix refcnt leak in skbmod
Date: Fri, 11 May 2018 16:37:45 -0400 (EDT)	[thread overview]
Message-ID: <20180511.163745.2157469759187444780.davem@davemloft.net> (raw)
In-Reply-To: <1526063733-7813-1-git-send-email-mrv@mojatatu.com>

From: Roman Mashak <mrv@mojatatu.com>
Date: Fri, 11 May 2018 14:35:33 -0400

> When application fails to pass flags in netlink TLV when replacing
> existing skbmod action, the kernel will leak refcnt:
> 
> $ tc actions get action skbmod index 1
> total acts 0
> 
>         action order 0: skbmod pipe set smac 00:11:22:33:44:55
>          index 1 ref 1 bind 0
> 
> For example, at this point a buggy application replaces the action with
> index 1 with new smac 00:aa:22:33:44:55, it fails because of zero flags,
> however refcnt gets bumped:
> 
> $ tc actions get actions skbmod index 1
> total acts 0
> 
>         action order 0: skbmod pipe set smac 00:11:22:33:44:55
>          index 1 ref 2 bind 0
> $
> 
> Tha patch fixes this by calling tcf_idr_release() on existing actions.
> 
> Fixes: 86da71b57383d ("net_sched: Introduce skbmod action")
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>

Applied and queued up for -stable, thanks.

      parent reply	other threads:[~2018-05-11 20:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 18:35 [PATCH net 1/1] net sched actions: fix refcnt leak in skbmod Roman Mashak
2018-05-11 19:09 ` Cong Wang
2018-05-11 20:37 ` 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=20180511.163745.2157469759187444780.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kernel@mojatatu.com \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).