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 652A6A00C4; Tue, 26 Jul 2022 08:19:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35B0A42685; Tue, 26 Jul 2022 08:19:54 +0200 (CEST) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2058.outbound.protection.outlook.com [40.107.215.58]) by mails.dpdk.org (Postfix) with ESMTP id 3DF3A40695; Tue, 26 Jul 2022 08:19:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZgAIiai5BoklESaJ5JWIdoll/1PU/9XMe8HIEoywPaQVNE8V2gjxNPgWyuW8kwvybVkSdbKZfap3amq0h2e7XEMfTuIXI+Bd9ExzMPl6XzECYk8SfFOIhrCqNUpDolVySwVZcuT485TA3NdoZEof/sAgDQgI2E+MI7wdsCy07C9/R23OkEDJDdvd8/cLfANZtn9D9akeLEqEpDcEmtuIJbfdqLYWjNA4DEeQRqf3ZFUrFfrp1lB6Ix3OyVfOD30zqpuCbhUqV1CoH3QCm9fE6/0TVNbNAa/HEu7nYqmup27rIehKsX0l7oOgPpNKeDQ7NfCWFfi4KZlzvk/dD8a8uw== 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=Kwk4dvKLNPhEzwT5vcRqvRO3l8WcFjBW94KS37mD1qc=; b=g44+W46YcPrbZqLdFHTHQAonTC7oAEzGncIyY7+De1tW1xhdo3rkhF8YkviP+ph4HAj5Gxq8ENJ4A2Jj16s4a6MBi/L2t+JrwhtxgTNGenKeNZOL0rlP35LvMB7uTKSoD//0BaY+Ckk4Nhx8rcAWM8LPUBS3NZIbMTd2BBcWmKs8JBsrHg9qd5S4E3VQlTnVRJXsW6Yke5yZZ4o0PtK6VXcWaY054tVozfKi0LuSk9GgrFoupuIWuSYSgsSI8MfIodgQNwwrodfTSZiAiR4M0YjvamnSfJKC+UBGVzLQKibUTIyKbIHAkwyUSBYiSWesMcWnCdhnIZVteY2r24yP/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kwk4dvKLNPhEzwT5vcRqvRO3l8WcFjBW94KS37mD1qc=; b=G41ecjVkulBI0ZTbwCWfWtu9MNTZ6V9XLx3OIpkhkYdUTNMzxDcykkCFH7zgj/UUSUTcYbpFcA/XZ6Sl486U2xJfGh7cmlmDaMJ5o9gW3zveEE6FFbxbPAKjpdM/awDoMoY08ppycAU3yn4SRQzWky7oa87NSlHFmJ4BkBwdG/9+c3c8uyGBHiKEhcemd1FMi2g2SRQdFwVcNLaYkoelhNfm2D91JOUaKPLgnNZ5CO5Nr8OGEd4ZNrGv+DdSuAUm5hibyXqLnlrZKnsY5VzQ24w3vXPvFqlrCdMXmIpfQrBb6xlIGevW0lep+PG+qiKdhn+q3Te8L25XWaQEv5ivqg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from KL1PR0601MB4530.apcprd06.prod.outlook.com (2603:1096:820:64::10) by TY2PR06MB2686.apcprd06.prod.outlook.com (2603:1096:404:40::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Tue, 26 Jul 2022 06:19:48 +0000 Received: from KL1PR0601MB4530.apcprd06.prod.outlook.com ([fe80::59b6:ff9c:d103:9e97]) by KL1PR0601MB4530.apcprd06.prod.outlook.com ([fe80::59b6:ff9c:d103:9e97%9]) with mapi id 15.20.5458.025; Tue, 26 Jul 2022 06:19:48 +0000 From: Jun Qiu To: dev@dpdk.org Cc: chas3@att.com, humin29@huawei.com, radu.nicolau@intel.com, stable@dpdk.org Subject: [PATCH 1/2] net/bonding: fix xmit l34 hash calculate for tcp Date: Tue, 26 Jul 2022 06:19:24 +0000 Message-Id: <20220726061925.21073-1-jun.qiu@jaguarmicro.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SGBP274CA0011.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::23) To KL1PR0601MB4530.apcprd06.prod.outlook.com (2603:1096:820:64::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd1f95cb-2203-4d16-d475-08da6eced76b X-MS-TrafficTypeDiagnostic: TY2PR06MB2686:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uo70Vp2Ju+0BUkL+K5evwMELOAZ6vSr3LxR9MBmBxbQuBg6VI8CsFcHYT/pUSzB+pV6MJOr709QCuqGTl1g2G2OtZSCZ++J7ffqHGWqBbFbDg06Nox2otKQCr+YUAWZSwWi9qRgcm0WdkBCrJCnkWjfB5p0Wi/GqNq41CzngjzvblAeTxIUqwDlF5SRExXbPNnfqI9aQNy+ow1jwPge+3ftJ4bwK1GQNRJeX1p35WEE+WFayWcP124jbLtgdHm8omaFwFVWSKFvhINMXLE7HLtGZXEOttjL5hyUb3WyKluZCnXFcaYApM1U4xr7xs7npY0H3Vbt9K5oZZ/YoPHIcyQCr1RlYlUqqBzeP08xt8qhDdSk/njfZnYPriGbiYgbELkP48kqHOYXYT5Hxpzyx5EyhaN6v9Y/LgNnZLeUYaV0pDGRluU2vFkU5conlOsANerMw9RsKfmw75GtWT5UtU0za4dh44a+UUcGUsLNLENIyckiSxlVUzIcS8YCHPWITw6tRq0a96uFbfyucRlGbyy22aSorbYJZ72x8D1d9xxggBTsAH+kORRZaEhQXRP1SRkZh+u7xiGRHQ6GaeDVSra/q9nba8L40Nax64lmnrm7nTKEWrHRf2jfQceBwjiAyof4Q5pniZS/vjIkGJ0EpxOuWRJsOiHUCCBF/Pot+tB+0fGP5e2ISgI/RWknyaWTOlLF+NSNkLCIACHxENAskId+tgNYlW67ZLoljxa7BIOzo0/eZWqsDusX2aImxlGqS7Bhky78ayoIaX0Sg7YEeqNJxjN689/EbZSUhAlnId7k= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB4530.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(396003)(136003)(39830400003)(346002)(366004)(376002)(186003)(83380400001)(2616005)(66946007)(6916009)(1076003)(66476007)(66556008)(8676002)(52116002)(36756003)(6512007)(6666004)(41300700001)(4326008)(6506007)(26005)(2906002)(38350700002)(86362001)(38100700002)(44832011)(5660300002)(316002)(478600001)(6486002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?uP7QGsHTCzNapm+75e5ttQZMdYNDOYCTMRC2PncRKArb8xVd7R/Sqm8cIDYQ?= =?us-ascii?Q?yN6BRgHxmvJMirF/okrwoL7MQYfj7+SwLQDv+ncgwIaB8AwHUqGIMKrBAT2/?= =?us-ascii?Q?QnbsemVTUJlI2uudsrLjlVTh5plo/TLsJmEiVOnCFEMsyhhSAKsDKK5dl+Dc?= =?us-ascii?Q?sRA1Ur4fmPLV1JrJ6u8FXsPm+A3v0MhhuMs1jtXLF+rbv5U0e1a2xt23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AVAyaK/P8SeO82f0bd2iqq3xe3Gl74T?= =?us-ascii?Q?9z0Le751Is0ercoUavVpJ4qEJlhSeP4JZu+Js1cBrj87Jh1uMqV/TA3VwOT7?= =?us-ascii?Q?8ck9Py3Fhl6shPnmdg5a2NY1b4ahHdr2dQPXNx7V6pfzPEINfQMQvJ6nocjk?= =?us-ascii?Q?FrtweqR9qn7Wkgls+UJR3R5uixpjzs6ig9xAwORqDBX/UCEoops3F8Jc0izv?= =?us-ascii?Q?KLtWdQrVBWLQm5gNRBuMZMhaNCVcHjajZ91e2mdQLu7E6OgyI7n0TFZzREYf?= =?us-ascii?Q?dVMAl1cifIMXD/DOJCarqZPwqBYEWYn7sHt2QP0vFxVFYTfH2x1m2edOjnQe?= =?us-ascii?Q?kUeHZC9JKgBlYockMjICmcEVcSu0fV7hBAH8B9lNuOfET8bkt76+L6w6QzRn?= =?us-ascii?Q?j/csKzvHd3JRYydutLzkKl8GjgVyjkhWO8h48wbV2nXSdOS5znaZPJYQQXu6?= =?us-ascii?Q?DQnfSPI01Su+z+1UYEQJwwnG4TqikCCBY4A3UYpN?= X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd1f95cb-2203-4d16-d475-08da6eced76b X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4530.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2022 06:19:48.3926 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OBcq0MkCepx7KhJZdlRSrCJ3Fd6BgconqKDFuBK3SX2NL61XyvY/SBZ1vs5t4v6d8VwTkNMQ3kTyRyX+SEI+5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR06MB2686 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 In the following two cases, tcp_hdr + sizeof(*tcp_hdr) == pkt_end, and the TCP port is not taken into account in calculating the HASH value of TCP packets. TCP connections with the same source and destination IP addresses will be hashed to the same slave port, which may cause load imbalance. 1. TCP Pure ACK packets with no options, The header length is 20 and there is no data. 2. A TCP packet contains data, but the first seg of the mbuf contains only the header information (ETH, IP, TCP), and the data is in subsequent segs, which is usually the case in the indirect mbuf used for zero-copy. Fixes: 726158060d55 ("net/bonding: fix potential out of bounds read") Cc: stable@dpdk.org Signed-off-by: Jun Qiu --- drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 73e6972035..3bf978e2df 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -768,7 +768,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, ((char *)ipv4_hdr + ip_hdr_offset); if ((size_t)tcp_hdr + sizeof(*tcp_hdr) - < pkt_end) + <= pkt_end) l4hash = HASH_L4_PORTS(tcp_hdr); } else if (ipv4_hdr->next_proto_id == IPPROTO_UDP) { -- 2.25.1