Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1417230imm; Thu, 5 Jul 2018 23:01:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpebXE6xaj/8TRf8EjZEXFNYght55VUwrPgc6xVhSGY6au3RW9WUDHuWxKojKF93SWtPaoLg X-Received: by 2002:a62:2c46:: with SMTP id s67-v6mr9109538pfs.153.1530856904086; Thu, 05 Jul 2018 23:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530856904; cv=none; d=google.com; s=arc-20160816; b=VG4Me2KfNapBha1HdaucYFfVEvtTp6h2jbk5XXBPq3RzgJKIuq/T6SbqZ+qpymfs81 8dUWVABDxPo4gWHiB4g0RvlnqnXXjOaRN0XRTCL4oTkBf8YfLgh5LjJuajN7euILcRc7 5eIeXZZtR4itAUcaY0gr57wbPPWtqAxbuK95ERNvnBPMU2e0pSeUgHqVtQrJusSPiQCA WW5d2o58RMSmU0FkN4LSwhO6CujtnX7jDogKhyjvJaliUmhGXwSOI4BVk6w+lWNmrb/6 SuLcTUdcp6rHS+TEIDLwMZ29wZ/GXEZy9pN/uUDpEyESn9Uz+yGqxtLDfw1hmhoRPAu9 P0bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fsf4FN++37EmutKBA5T9OTFkGfdoABQzqxYeeFSd1aE=; b=trotXQzKAVWVwXifSmyMlnNdkNeNbdTlNQtSdOXMk+N6K3bIsofyFwUggQCYUPNgyJ 4p3y60dO9veeooxLuU0RKntVRQWlGSm76xg7Wndr+NkXJGylxfSRGo1lSajii30TdKsy ALpBAdfThDHYSEhoAvVsqdeblAqquVAtRDGJoW01WJ71rdHdBh5k1B9pD5WEcSsoJSHC UpRNEzwhe+vJ7lbgNXWoclJR66DawKPKBt0jE7stpbek98BBSzl4onTOg5osayLq9I0M lpe3ZaiTvnpYu/Muz3osSiEFlKnpZ/zjdUVV6FIeWZp8uNCVNyzxJeFq4x7XF/+8wkKG +PDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16-v6si7040708pgd.12.2018.07.05.23.01.29; Thu, 05 Jul 2018 23:01:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934106AbeGFFvC (ORCPT + 99 others); Fri, 6 Jul 2018 01:51:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33142 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933976AbeGFFu7 (ORCPT ); Fri, 6 Jul 2018 01:50:59 -0400 Received: from localhost (D57D388D.static.ziggozakelijk.nl [213.125.56.141]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F0B6986A; Fri, 6 Jul 2018 05:50:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 4.14 29/61] netfilter: nf_tables: disable preemption in nft_update_chain_stats() Date: Fri, 6 Jul 2018 07:46:53 +0200 Message-Id: <20180706054713.453772361@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180706054712.332416244@linuxfoundation.org> References: <20180706054712.332416244@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pablo Neira Ayuso commit ad9d9e85072b668731f356be0a3750a3ba22a607 upstream. This patch fixes the following splat. [118709.054937] BUG: using smp_processor_id() in preemptible [00000000] code: test/1571 [118709.054970] caller is nft_update_chain_stats.isra.4+0x53/0x97 [nf_tables] [118709.054980] CPU: 2 PID: 1571 Comm: test Not tainted 4.17.0-rc6+ #335 [...] [118709.054992] Call Trace: [118709.055011] dump_stack+0x5f/0x86 [118709.055026] check_preemption_disabled+0xd4/0xe4 Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_tables_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/netfilter/nf_tables_core.c +++ b/net/netfilter/nf_tables_core.c @@ -126,15 +126,15 @@ static noinline void nft_update_chain_st if (!base_chain->stats) return; + local_bh_disable(); stats = this_cpu_ptr(rcu_dereference(base_chain->stats)); if (stats) { - local_bh_disable(); u64_stats_update_begin(&stats->syncp); stats->pkts++; stats->bytes += pkt->skb->len; u64_stats_update_end(&stats->syncp); - local_bh_enable(); } + local_bh_enable(); } struct nft_jumpstack {