From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [Patch net v2] xt_RATEEST: acquire xt_rateest_mutex for hash insert Date: Mon, 05 Feb 2018 15:25:11 -0800 Message-ID: <1517873111.3715.146.camel@gmail.com> References: <20180205224145.9420-1-xiyou.wangcong@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netfilter-devel@vger.kernel.org, Pablo Neira Ayuso To: Cong Wang , netdev@vger.kernel.org Return-path: In-Reply-To: <20180205224145.9420-1-xiyou.wangcong@gmail.com> Sender: netfilter-devel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Mon, 2018-02-05 at 14:41 -0800, Cong Wang wrote: > rateest_hash is supposed to be protected by xt_rateest_mutex, > and, as suggested by Eric, lookup and insert should be atomic, > so we should acquire the xt_rateest_mutex once for both. > > So introduce a non-locking helper for internal use and keep the > locking one for external. > > Reported-by: > Fixes: 5859034d7eb8 ("[NETFILTER]: x_tables: add RATEEST target") > Cc: Pablo Neira Ayuso > Cc: Eric Dumazet > Signed-off-by: Cong Wang > --- Reviewed-by: Eric Dumazet Thanks !