From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] tun: fix rcu_read_lock imbalance in tun_build_skb Date: Sun, 19 Nov 2017 21:24:16 +0900 (KST) Message-ID: <20171119.212416.1338898200006482751.davem@davemloft.net> References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, jasowang@redhat.com To: lucien.xin@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:52854 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822AbdKSMYX (ORCPT ); Sun, 19 Nov 2017 07:24:23 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Xin Long Date: Sun, 19 Nov 2017 19:31:04 +0800 > rcu_read_lock in tun_build_skb is used to rcu_dereference tun->xdp_prog > safely, rcu_read_unlock should be done in every return path. > > Now I could see one place missing it, where it returns NULL in switch-case > XDP_REDIRECT, another palce using rcu_read_lock wrongly, where it returns > NULL in if (xdp_xmit) chunk. > > So fix both in this patch. > > Fixes: 761876c857cb ("tap: XDP support") > Signed-off-by: Xin Long Good catch, applied, thanks!