Message ID | SY4PR01MB67987E3CF6AC3E274667CE51F6149@SY4PR01MB6798.ausprd01.prod.outlook.com |
---|---|
State | Deferred |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=outlook.com header.i=@outlook.com header.a=rsa-sha256 header.s=selector1 header.b=VOOb2CDR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GPK513bkRz9sXM for <incoming@patchwork.ozlabs.org>; Tue, 13 Jul 2021 22:02:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C22982F0C; Tue, 13 Jul 2021 14:02:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=outlook.com header.i=@outlook.com header.b="VOOb2CDR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CFAA983144; Tue, 13 Jul 2021 14:02:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,FREEMAIL_FROM, MSGID_FROM_MTA_HEADER,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from AUS01-ME3-obe.outbound.protection.outlook.com (mail-me3aus01olkn20816.outbound.protection.outlook.com [IPv6:2a01:111:f403:7004::816]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4535082F0C for <u-boot@lists.denx.de>; Tue, 13 Jul 2021 14:02:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tianrui-wei@outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QcFEs27/8nxYBlMYFE5hToNAPFAULghS9sxYseHAmrK5if+N/LKD1kkKZ3SUi3vyWjCUL73TUI1mv9c/MzDVMmaoi9sm+02s1DPoPuhu7byY6eqatEKWcaFg92DzvSp5cywFkISsjK377rNTc+liZgv2gZN2vP/kW8NkjmIWrldvtlIeONLuWaYZIIsEU2Z9fQQhHENBb2UBGj18+EEbCC1DNPS4MYMriGnvS/Wx84cMJ43bQ7S3L1dO4YlbZLX6Teq1T291uHirB6PeuXa/3jixp76LMeHp+PzPq2Wv1Fk8lcVkg3M+XaT3tPOoJPvnBPInxH9VCaEFjnw0Pc8JSQ== 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-SenderADCheck; bh=3feZnXKobNvkr2N7kUHEtkCU5lEJg8itDTgeEya0DVg=; b=QqA3VuueWy0m8eH4JPQteHKwrtoySoC7n/1JnV0icGxC6E9/N1XwTg6XXEtHMfDQgG1OYb+SlYiTUc9ZdaNohBmtDHCaU39+e1TBWBKoSSH1KYbVyxlpRNJo08MVzK7Zs/e9RhmoykDhi19U5m9328dK62Q0re+eRiwS57cMU1OYvJTf/n4gSrDyKf4zmYPkU89LSJAHIUKFy9+75q1CeOzwM5gYOQESQB0QqIN2A79zUfjtuYxFIPuo0eQVKYj5vPbNHizag/99QCDv0OYyREj5MAtquoELQOZKUCSMivtwGjxPmwu8OxiancP1cG5ZA+3CwdXeau5U7H8pfWgp0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3feZnXKobNvkr2N7kUHEtkCU5lEJg8itDTgeEya0DVg=; b=VOOb2CDRmA+7HV2pTPDqI5el5n8Vzy0YIGrZMF7AlKmZks4b3K83ymxwEoX5M5DQzdJXQTpebU8bOjSiB3Kg/oHGw0p9ojey7avIO5JAvjxeK7u9qirckwcPnZwHSDFpVde90A5kfHWcgDBt0Ar30W5tbrSBZXVLxfAWb5P3/m6vUhBEuxa9WZ9GeknCsumw4ZdHgZeT/9RBxuaUCrKQvdcoDwa8O40K42Zf5WafKXQ/RVY7/Xvxjr1JAbB8et8wvOYHbBl+T44ItlFip9+Q63wZfOgUWms6hMDamaw1Lj02lPkCaVXQ7QSDoUzf5i4xTBCYdWTJ9Yl3Zakpds2Ixg== Received: from SY4PR01MB6798.ausprd01.prod.outlook.com (2603:10c6:10:137::12) by SYXPR01MB1184.ausprd01.prod.outlook.com (2603:10c6:0:31::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Tue, 13 Jul 2021 12:02:12 +0000 Received: from SY4PR01MB6798.ausprd01.prod.outlook.com ([fe80::a44f:289d:7a25:339b]) by SY4PR01MB6798.ausprd01.prod.outlook.com ([fe80::a44f:289d:7a25:339b%4]) with mapi id 15.20.4308.027; Tue, 13 Jul 2021 12:02:12 +0000 From: Tianrui Wei <tianrui-wei@outlook.com> To: Joe Hershberger <joe.hershberger@ni.com>, Ramon Fried <rfried.dev@gmail.com>, Michal Simek <monstr@monstr.eu> Cc: u-boot@lists.denx.de Subject: [PATCH] net: emaclite: fix possible underflow bug Date: Tue, 13 Jul 2021 20:01:53 +0800 Message-ID: <SY4PR01MB67987E3CF6AC3E274667CE51F6149@SY4PR01MB6798.ausprd01.prod.outlook.com> X-Mailer: git-send-email 2.32.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [0IRwmIdsOa+jkGPVRp43LOOVANV9QGhb] X-ClientProxiedBy: HK2PR06CA0015.apcprd06.prod.outlook.com (2603:1096:202:2e::27) To SY4PR01MB6798.ausprd01.prod.outlook.com (2603:10c6:10:137::12) X-Microsoft-Original-Message-ID: <20210713120153.673074-1-tianrui-wei@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (180.160.46.166) by HK2PR06CA0015.apcprd06.prod.outlook.com (2603:1096:202:2e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 12:02:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b072eb5-0bb6-42da-0a76-08d945f60c26 X-MS-TrafficTypeDiagnostic: SYXPR01MB1184: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LeCeq7+b+4KXIJcSJExNlOi06NeQseptjnkksR6Jip0F5ORNXD3dB8BOc+h1Besr5bDhoiLxq49HpwpP3kkF1dUKkSqwvaKNXONvy5b0Vft97Ph6R1MdYyVPQLD8d/njEwavtf5M9lIo1eWaF12gREWLdo9jg9NmpU1mMXMA8bXRc1voHoXSk6Zy0U+XdX8Z/RzY0VIxXRYKJe2QsFvyRQafJ2m2wsxQU2/Tq8SC0CvX57/6gd37ePok6z4JL3DoEv8dxqFirJwM3OimA0XoSgSmbIDzQy2pY9LMm4aJ5FKxvydl033qnZkzWfVIPxU1OvnTAC2aYwZq99PwIzTOwcVSZh559kTv8LZqwOebzBj3XcLRdYGQF8fQ6kS/OnTU20eKzejoIrxdiyrSWJH+10E+qnoerFAR0UAt6BQ7SHU= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8sevmAJo5f762FA545Y+2Dmjd3RmVS/2b5yMO4JmBI2cAeLkd34EGfCuCTtWZ1I+BHuovFtf95F54ub9kmLX7+E/AM/YgYt9M09ZpUXcBYihHEWzUhTi9fcDQxc+e5IH02zYv7XqwlgUnoPv/5omPQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b072eb5-0bb6-42da-0a76-08d945f60c26 X-MS-Exchange-CrossTenant-AuthSource: SY4PR01MB6798.ausprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 12:02:12.1659 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SYXPR01MB1184 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
net: emaclite: fix possible underflow bug
|
expand
|
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index 43fc36dc6a..3b8f0f4678 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -526,7 +526,7 @@ try_again: } /* Read the rest of the packet which is longer then first read */ - if (length != first_read) + if (length >= first_read) xemaclite_alignedread(addr + first_read, etherrxbuff + first_read, length - first_read);
This commit fixes a corner case when length < first_read. which would cause the last argument of xemaclite_alignedread to be a very large unsigned integer. Signed-off-by: Tianrui Wei <tianrui-wei@outlook.com> --- drivers/net/xilinx_emaclite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)