lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55BB48B8.6060201@iogearbox.net>
Date:	Fri, 31 Jul 2015 12:06:48 +0200
From:	Daniel Borkmann <daniel@...earbox.net>
To:	Cong Wang <xiyou.wangcong@...il.com>, netdev@...r.kernel.org
CC:	davem@...emloft.net, Jamal Hadi Salim <jhs@...atatu.com>,
	Cong Wang <cwang@...pensource.com>
Subject: Re: [Patch net] act_mirred: avoid calling tcf_hash_release() when
 binding

On 07/31/2015 02:12 AM, Cong Wang wrote:
> When we share an action within a filter, the bind refcnt
> should increase, therefore we should not call tcf_hash_release().
>
> Cc: Jamal Hadi Salim <jhs@...atatu.com>
> Cc: Daniel Borkmann <daniel@...earbox.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
> Signed-off-by: Cong Wang <cwang@...pensource.com>
> ---
>   net/sched/act_mirred.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
> index a42a3b2..2685450 100644
> --- a/net/sched/act_mirred.c
> +++ b/net/sched/act_mirred.c
> @@ -98,6 +98,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
>   			return ret;
>   		ret = ACT_P_CREATED;
>   	} else {
> +		if (bind)
> +			return 0;
>   		if (!ovr) {
>   			tcf_hash_release(a, bind);
>   			return -EEXIST;
>

Did you test all variants on this?

I.e. what happens when you replace an existing one, I think the
refcnt should also be dropped here. It looks like we only drop
it, in case we tried to add an action to an already existing index ...

	[...]
	} else {
		if (bind)
			return 0;
		tcf_hash_release(a, bind);
		if (!ovr)
			return -EEXIST;
	}
	[...]

Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ