Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32B4DC432C0 for ; Wed, 27 Nov 2019 07:28:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A2912075C for ; Wed, 27 Nov 2019 07:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726282AbfK0H2V (ORCPT ); Wed, 27 Nov 2019 02:28:21 -0500 Received: from inva021.nxp.com ([92.121.34.21]:41346 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbfK0H2V (ORCPT ); Wed, 27 Nov 2019 02:28:21 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BC8C920018D; Wed, 27 Nov 2019 08:28:19 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C53B020001F; Wed, 27 Nov 2019 08:28:16 +0100 (CET) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id BC8364028F; Wed, 27 Nov 2019 15:28:12 +0800 (SGT) From: Yangbo Lu To: netdev@vger.kernel.org, Alexandre Belloni , Microchip Linux Driver Support , "David S . Miller" , Vladimir Oltean Cc: Yangbo Lu Subject: [v2, 0/2] net: mscc: ocelot: fix potential issues accessing skbs list Date: Wed, 27 Nov 2019 15:27:55 +0800 Message-Id: <20191127072757.34502-1-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix two prtential issues accessing skbs list. - Break the matching loop when find the matching skb to avoid consuming more skbs incorrectly. The timestamp ID is only from 0 to 3 while the FIFO supports 128 timestamps at most. - Convert to use skb queue instead of the list of skbs to provide protect with lock. --- Changes for v2: - Split into two patches. - Converted to use skb queue. Yangbo Lu (2): net: mscc: ocelot: avoid incorrect consuming in skbs list net: mscc: ocelot: use skb queue instead of skbs list drivers/net/ethernet/mscc/ocelot.c | 55 +++++++++++++------------------------- include/soc/mscc/ocelot.h | 9 +------ 2 files changed, 20 insertions(+), 44 deletions(-) -- 2.7.4