Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp946214imu; Wed, 28 Nov 2018 02:03:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/WnyXuQH27/VtQIEe63ByMgdeD3mg0dovRkEspTNIspsN6/Arb+QlgXvJn5PYePKmKlDgX4 X-Received: by 2002:a62:53c5:: with SMTP id h188mr26435537pfb.190.1543399387595; Wed, 28 Nov 2018 02:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543399387; cv=none; d=google.com; s=arc-20160816; b=m0SLd1RhwLLa95HQqUiorjk79BNuCj8yMiYYf4YROmWJBAwxTqjrI3BhGsYW3dpQkC 8MqDNT+Bblo3WIPq9siHPL8vrRtm339juaja3n5dMVvKCygG90LXDQlk1sUJOg43E94S MAtCR0+IuSPD75rnxkkpkb3kjxm6zM2nzLlkwfTTiJ/DRjcMccxi7bz0kFUKf2kU9lLF kKiGakYUFx3WYsKjqtgiMtn3Cd/MfxFfaAGwutrXxQyYCUlfwyh+fP+0CTp1zu8RNnOg sB5HRRU6ZRC6cfOigQrax8fyy95IRtCex64Zf068mrSiypiOZ45JCFoWvFbTnWbkz/ub Ry9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=2eEYBroUcxoZKIvO1Pwga1iilzoXVCMNhPoUiqSwc+w=; b=0zT1vhEOA63TZ93FXT5ON3fXnpgIXDE7hlNkBlZgpwoCMVlgWfA38pcTPMYDjca/G1 MC/cFqqg3uAAJy1WFpFB6sR8OC8EZDU4+RyD+bf9q/PLxg91Lb84f73VGOdoJkIhq5GA NIJamRE49y/PIJQsTcoZXiyj83O6evTBrVj4oOvjn3L0zzx6AtZ4Yq2+SisuPt9mzR0G OlCpH68qcHDRZQonx4IMRoXzuLk0ryRDtFQudTaiSEbBQniwNE3EH2dCu+zsfd9Fi9gg Yj/MKDVLpW0ZOpyTgbsaMcPdsy1+HxWKAj3MghRA8YWaPbhdB4xWtLVlwUiCBiInPHi+ aYLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=C8vlNCrl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h31si6863086pgl.482.2018.11.28.02.02.51; Wed, 28 Nov 2018 02:03:07 -0800 (PST) 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; dkim=pass header.i=@synopsys.com header.s=mail header.b=C8vlNCrl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728183AbeK1VDP (ORCPT + 99 others); Wed, 28 Nov 2018 16:03:15 -0500 Received: from smtprelay.synopsys.com ([198.182.60.111]:46138 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbeK1VDP (ORCPT ); Wed, 28 Nov 2018 16:03:15 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id EEC3610C11A4; Wed, 28 Nov 2018 02:02:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1543399329; bh=2eEYBroUcxoZKIvO1Pwga1iilzoXVCMNhPoUiqSwc+w=; h=Subject:To:References:CC:From:Date:In-Reply-To:From; b=C8vlNCrlQK68Vvv0xR4XY8kw8gcy5uIeIgonuxbKeWy88GUj463WaXNOCv4fDjA3i kRaZ6MGGa2/xEzcYNvqAsFzM+p8fyKsBWwdeElWvPxDYUjGxZk+SsVViZcgf9xwaFT 4QWWa5oHp/qMeotxFLlJ0uexhPcmt1Rp0WyiiSElji6avbNja8ZL+V8nC+X9joAtj3 CeGQtaRqiriE5vYbLKj7f9Fxx2Skysbf6DLYdRCOusvVtlfWVYMDiSUN26mIrSbvRK SIGG4Lp5c8wNVIZN09fx13Lhsu1N4pPRmDhCC7ez5axvXtIY5qxAsEHGZBoXAqbtM2 HwUUgBpRrvyhA== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id DD8E33E81; Wed, 28 Nov 2018 02:02:08 -0800 (PST) Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 02:02:08 -0800 Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by DE02WEHTCA.internal.synopsys.com (10.225.19.92) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 11:02:07 +0100 Received: from [10.0.2.15] (10.107.19.26) by DE02WEHTCB.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 11:02:07 +0100 Subject: Re: [PATCH] net: dwc-xlgmac: set skb to NULL after freeing it To: Pan Bian References: <1543396853-35188-1-git-send-email-bianpan2016@163.com> CC: "David S. Miller" , , From: Jose Abreu Message-ID: <71f99f51-6bdc-0a25-d81c-12dc13f61271@synopsys.com> Date: Wed, 28 Nov 2018 10:02:05 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1543396853-35188-1-git-send-email-bianpan2016@163.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.107.19.26] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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