From: Jose Abreu Subject: Re: [PATCH] net: dwc-xlgmac: set skb to NULL after freeing it Date: Wed, 28 Nov 2018 10:02:05 +0000 Message-ID: <71f99f51-6bdc-0a25-d81c-12dc13f61271@synopsys.com> References: <1543396853-35188-1-git-send-email-bianpan2016@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , , To: Pan Bian Return-path: In-Reply-To: <1543396853-35188-1-git-send-email-bianpan2016@163.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 28-11-2018 09:20, Pan Bian wrote: > The buffer skb is freed via dev_kfree_skb in a loop. After freeing skb, > the value of packet_count is updated via packet_count++. If packet_count > happens to equal the upper bound (i.e., budget), the loop will be broken > and skb may be assigned to desc_data->state.skb. Resulting that > desc_data->state.skb may point to a freed memory chunk. To fix this, the > patch sets skb to NULL after dev_kfree_skb(skb). > > Signed-off-by: Pan Bian This is missing the Fixes tag and your patch prefix should be [PATCH net]. Thanks and Best Regards, Jose Miguel Abreu