From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] net: bpfilter: use get_pid_task instead of pid_task Date: Wed, 17 Oct 2018 22:04:39 -0700 (PDT) Message-ID: <20181017.220439.2058059014966719056.davem@davemloft.net> References: <20181016153510.16962-1-ap420073@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, daniel@iogearbox.net, ast@kernel.org To: ap420073@gmail.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:54694 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727328AbeJRNDs (ORCPT ); Thu, 18 Oct 2018 09:03:48 -0400 In-Reply-To: <20181016153510.16962-1-ap420073@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Taehee Yoo Date: Wed, 17 Oct 2018 00:35:10 +0900 > pid_task() dereferences rcu protected tasks array. > But there is no rcu_read_lock() in shutdown_umh() routine so that > rcu_read_lock() is needed. > get_pid_task() is wrapper function of pid_task. it holds rcu_read_lock() > then calls pid_task(). if task isn't NULL, it increases reference count > of task. > > test commands: > %modprobe bpfilter > %modprobe -rv bpfilter ... > Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module") > Signed-off-by: Taehee Yoo Applied and queued up for -stable, thanks.