From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5101A0548; Thu, 25 Aug 2022 18:39:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A76F740223; Thu, 25 Aug 2022 18:39:29 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2047.outbound.protection.outlook.com [40.107.92.47]) by mails.dpdk.org (Postfix) with ESMTP id 418EB40156; Thu, 25 Aug 2022 18:39:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c4gtV30Mj5l1RTxmovuHrb1ly/RuXHgDtFTEnxAUHknN9Rfl9Y/1XgxZ/GPincdrsxWQsrlbvfuPvBstn+EVjBBc+ksYxkHkWRmbKtM62nHZ5M4nMqwnzUg9ndItUmoO3tIni8c5JuBKu2Sv1HF6Y4NGKjOEIB7jenYkgldM8IXfuL1WrxQWMi7K3hk4TEPEOcizqTGUSAyp+E6lIzfRkfmYKT7vZvkoEmRDMrLLvH33zecPr9SR9mBOPNzOlP6Ngj7Yu3uHwchiD+E2IEzhWXfTIttTXtL/JMA1E9dt9yt+AQokibiSTdlZROMukri3ByPv8qoopY9F96f7SGsGNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ubJUuYhwA/ZO/9AaxN2itRkEPsRD2rRbk/wTXIHSOAE=; b=SjSmSyfG/qe1KPAirLJlZ1N5dKvZx3pKKmKH+MZKBp7Sthd/t/9IJkrduPuyIMyS6T/ze2bP0hHSJnCkBMowC3e5SalQYb90faoukTDl5tQk27cO7uVsYEJ7XGUH5LaBguamQR0/3taQRr6kNlJItQPEP3V4/r/aQX0JR9Or+th+rcvYDt2xWYZnFowHmULaxXKWA1bo0AI46fnpbK5+a44QKs2bfNdFDnZifM7EJAy6Q74q876uTorbZ6r6X+gmBIeNAlfwh3UEWuc2PeI1w3mF/DsSJvpqS3qXY6nCzypmLVNUeWZp+y5kVFeoxZt6274d+hQudfrMSU06B6aH4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=huawei.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ubJUuYhwA/ZO/9AaxN2itRkEPsRD2rRbk/wTXIHSOAE=; b=GwqDq0R81WfS7goTSMgw8I56II3BLGP6habZJGWXQSZCS1nh97royungVC/wt+7KOmZYxhxLUO7JF1I3nnUouDRaM3pAVkKF/xfQ1o/pp4dhTfwsKlsqlXSbGysjkuhR3/13y5eO3yxGXLzNb48Luv6OMO0dridJ4AFxurVsAQ8= Received: from BN0PR03CA0019.namprd03.prod.outlook.com (2603:10b6:408:e6::24) by MW4PR02MB7345.namprd02.prod.outlook.com (2603:10b6:303:7c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Thu, 25 Aug 2022 16:39:22 +0000 Received: from BN1NAM02FT021.eop-nam02.prod.protection.outlook.com (2603:10b6:408:e6:cafe::a3) by BN0PR03CA0019.outlook.office365.com (2603:10b6:408:e6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 16:39:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch02.xlnx.xilinx.com; pr=C Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by BN1NAM02FT021.mail.protection.outlook.com (10.13.2.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Thu, 25 Aug 2022 16:39:21 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 25 Aug 2022 17:39:20 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 25 Aug 2022 17:39:19 +0100 Envelope-to: humin29@huawei.com, wangyunjian@huawei.com, dev@dpdk.org, chas3@att.com, huangshaozhang@huawei.com, jilei8@huawei.com, stable@dpdk.org Received: from [10.71.194.74] (port=53680) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oRFt1-0006wM-Ga; Thu, 25 Aug 2022 17:39:19 +0100 Message-ID: Date: Thu, 25 Aug 2022 17:39:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: =?UTF-8?B?UmU6IOetlOWkjTogW2RwZGstZGV2XSBbUEFUQ0hdIG5ldC9ib25kaW5n?= =?UTF-8?Q?=3a_fix_array_overflow_in_Rx_burst?= Content-Language: en-US To: "humin (Q)" , wangyunjian , "dev@dpdk.org" CC: "chas3@att.com" , Huangshaozhang , "jilei (F)" , "stable@dpdk.org" References: <20210810064323.4161835-1-jilei8@huawei.com> <23483205275b4639324b82c1607cd867327bf783.1658146483.git.wangyunjian@huawei.com> <5001c75008d9423c885747b51cb1ad55@huawei.com> From: Ferruh Yigit In-Reply-To: <5001c75008d9423c885747b51cb1ad55@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d64aa34-31a4-4b31-09ec-08da86b85c99 X-MS-TrafficTypeDiagnostic: MW4PR02MB7345:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dnRj/S/lldHOHzgq6lMwtNRqJzqheXpF6oBv04kAJ56/nx1vSi7PiRw/wsi194/eDg9wwL7e+DqlceWx1AqlMTahkN4jgrN7ZtbzNsk7ssvKid+pBCe+sLix6bBc9c/ulWP1Y0tNQLLLdFZw+mREAFODhUTAtwqeksyIKWiflhYlo2JJf5AWsYkIkXpbvtwrACdpCUfM7x8xS9DRwx5NDutAnCiKPDaseSAt8Ui/XcuS51QRvGxhAN+ErR3HLJ8VxEf5fSkK/ftdw3b1ogXFZTlTR4sFI56J9TO1EH+HK89SRBdHXnXmcn5/BJtDmxPuwhTVRD+qp+gUAPz/uj2bB+0VTser5piCxYxUbdEvHgZHPyNAvMJw3fB6CgVWlp5rdAdL2/KqkGYggkGfk5usSeFcR/Mip6bIPHNA4CNCruMFkDfEsm5eW2gg4okBqovlcVgPxbi4GmnaCN4DJxYHAFurWmFuWoJzjMY274YZotE8mzyF9MnZ70RcAaWa4PDPIhbTr63A5zD0rPi8Li7uMVxUUeyHPMEb+ghmcdU6nlzD/q38TjBnfFM3Si4EtJy7CRl0GknoEv1XLREE7O2yXDQERVs23VwGwVepuKYkZSwdZGOgxVFlMlIx/VqVql2TJkixwjaCwx5a5Ga3cIR1Gzkzq70q9kHxYrX+pWXq2SEvAHEeIvHfv4l03tk5JzFsymIkI5Jf9cO6VB19l5BZYjjLk465zu+r/Mf1UPo5KHLXhYcgfmJ0ZESS6bT/jyaSmymihAhk1vN5U7m2L+77FBsiOkLjTI7YhSrb5f8E9WHIdNGM8QWecR3cUQ1mZy0O/Dkaoxq7js2hPR73QeqiEg== X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(136003)(376002)(396003)(346002)(40470700004)(36840700001)(46966006)(54906003)(186003)(82740400003)(336012)(316002)(40460700003)(426003)(70206006)(4326008)(70586007)(31696002)(110136005)(40480700001)(47076005)(26005)(53546011)(41300700001)(356005)(31686004)(2616005)(82310400005)(7636003)(478600001)(224303003)(44832011)(36860700001)(2906002)(9786002)(8936002)(5660300002)(36756003)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 16:39:21.0265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d64aa34-31a4-4b31-09ec-08da86b85c99 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT021.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR02MB7345 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 7/20/2022 2:28 AM, humin (Q) wrote: > -----邮件原件----- > 发件人: wangyunjian > 发送时间: 2022年7月18日 21:09 > 收件人: dev@dpdk.org > 抄送: chas3@att.com; humin (Q) ; Huangshaozhang ; jilei (F) ; wangyunjian ; stable@dpdk.org > 主题: [dpdk-dev] [PATCH] net/bonding: fix array overflow in Rx burst > > In bond_ethdev_rx_burst() function, we check the validity of the 'active_slave' as this code: > if (++active_slave == slave_count) > active_slave = 0; > However, the value of 'active_slave' maybe equal to 'slave_count', when a slave is down. This is wrong and it can cause buffer overflow. > This patch fixes the issue by using '>=' instead of '=='. > > Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness") > Cc: stable@dpdk.org > > Signed-off-by: Lei Ji > Signed-off-by: Yunjian Wang > > Acked-by: Min Hu (Connor) > Applied to dpdk-next-net/main, thanks.