From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] net/sched: act_sample: fix NULL dereference in the data path Date: Fri, 14 Sep 2018 08:47:09 -0700 (PDT) Message-ID: <20180914.084709.404281793502117027.davem@davemloft.net> References: <2fcef6665503c5e3b17676daf45c4166cf130cdb.1536919144.git.dcaratti@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: mcroce@redhat.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, netdev@vger.kernel.org To: dcaratti@redhat.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:36764 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbeINVCP (ORCPT ); Fri, 14 Sep 2018 17:02:15 -0400 In-Reply-To: <2fcef6665503c5e3b17676daf45c4166cf130cdb.1536919144.git.dcaratti@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Davide Caratti Date: Fri, 14 Sep 2018 12:03:18 +0200 > Matteo reported the following splat, testing the datapath of TC 'sample': ... > tcf_sample_act() tried to update its per-cpu stats, but tcf_sample_init() > forgot to allocate them, because tcf_idr_create() was called with a wrong > value of 'cpustats'. Setting it to true proved to fix the reported crash. > > Reported-by: Matteo Croce > Fixes: 65a206c01e8e ("net/sched: Change act_api and act_xxx modules to use IDR") > Fixes: 5c5670fae430 ("net/sched: Introduce sample tc action") > Tested-by: Matteo Croce > Signed-off-by: Davide Caratti Applied and queued up for -stable, thanks.