[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpVCuhLcTapf=TnMA50zvbYA=ZyWEvy5JrnRqdoqgmOcJA@mail.gmail.com>
Date: Fri, 11 May 2018 12:09:14 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Roman Mashak <mrv@...atatu.com>
Cc: David Miller <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
kernel@...atatu.com, Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>
Subject: Re: [PATCH net 1/1] net sched actions: fix refcnt leak in skbmod
On Fri, May 11, 2018 at 11:35 AM, Roman Mashak <mrv@...atatu.com> wrote:
> 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@...atatu.com>
Acked-by: Cong Wang <xiyou.wangcong@...il.com>
Powered by blists - more mailing lists