From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB59CC433DF for ; Mon, 8 Jun 2020 08:57:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B0D9F2067B for ; Mon, 8 Jun 2020 08:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726536AbgFHI5A (ORCPT ); Mon, 8 Jun 2020 04:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbgFHI5A (ORCPT ); Mon, 8 Jun 2020 04:57:00 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AD60C08C5C3; Mon, 8 Jun 2020 01:57:00 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1jiDaO-0003uX-Ch; Mon, 08 Jun 2020 10:56:52 +0200 Date: Mon, 8 Jun 2020 10:56:52 +0200 From: Florian Westphal To: Stefano Brivio Cc: Pablo Neira Ayuso , kernel test robot , Florian Westphal , stable@vger.kernel.org, netfilter-devel@vger.kernel.org Subject: Re: [PATCH nf] nft_set_pipapo: Disable preemption before getting per-CPU pointer Message-ID: <20200608085652.GP28263@breakpoint.cc> References: <45861d795de2db1494b40bb2cc13bb36b4dacf72.1591606165.git.sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45861d795de2db1494b40bb2cc13bb36b4dacf72.1591606165.git.sbrivio@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Stefano Brivio wrote: > The lkp kernel test robot reports, with CONFIG_DEBUG_PREEMPT enabled: [..] > diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c > index 8b5acc6910fd..8c04388296b0 100644 > --- a/net/netfilter/nft_set_pipapo.c > +++ b/net/netfilter/nft_set_pipapo.c > @@ -1242,7 +1242,9 @@ static int nft_pipapo_insert(const struct net *net, const struct nft_set *set, > end += NFT_PIPAPO_GROUPS_PADDED_SIZE(f); > } > > - if (!*this_cpu_ptr(m->scratch) || bsize_max > m->bsize_max) { > + if (!*get_cpu_ptr(m->scratch) || bsize_max > m->bsize_max) { > + put_cpu_ptr(m->scratch); > + > err = pipapo_realloc_scratch(m, bsize_max); > if (err) > return err; > @@ -1250,6 +1252,8 @@ static int nft_pipapo_insert(const struct net *net, const struct nft_set *set, > this_cpu_write(nft_pipapo_scratch_index, false); Won't that mean that this_cpu_write() can occur on a different CPU than the get_cpu_ptr() ptr check was done on?