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 EF71C43ADF; Thu, 8 Feb 2024 15:45:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B0C54028B; Thu, 8 Feb 2024 15:45:12 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2042.outbound.protection.outlook.com [40.107.93.42]) by mails.dpdk.org (Postfix) with ESMTP id 27A6D40278; Thu, 8 Feb 2024 15:45:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ShPVjhHGih1K9gvpHnwkVizDsVqFBof0eyTZNGRyYjVf+rtP+wZyUKtu+puptT75fmATYsxoEFUIpSETXfRLIc3Xjv7/DE00Tl4L4g91rhxKO/WXZWayQgDZ2rvh2w40pJdc9xQ3ENOAFpV/Aj198kjyigDKHRpFzMzLrGB7aWrblsV0seCLbhy7w2xNGRLBAxXemrOf5GISGQ857pSGCdv3A8Kjav+D111UFZxZJvusw681FNPpsFK6802efxqE0u/vyMkoROpqJYAZcacjaeaaWt5SWtbS+HmGW0DMfGNnyWHerkUcP/KCE1UdDxVFBGsJok6qIb+HnB9LKp0MJw== 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=mkAHvpeljn8lfeXvcbyukgs8tse1A3586IDExXCv4HE=; b=NstQAwiLWMV8WemL0vmUqv+3fSrVz7v7OUh105scwe5+Cx/GU4t3Y7TBJsUDAhSOhr/L6VZXN1nrdgrKp99rKW3cotqG10cn6JfcTdNPcvWEPEnPv5fwsWlzJTb1ul5lRcqzucIgJb2RCuHTArBqGGF3Sd8RruTGVjpNlHrIJTwGAs/o879xCoM86o/8aOmEgUu0oR4UQG4AKyPUcOdNJq/lW7LQ38AfbuJVMhmqDUzk08RpJp0N93JS5kKkd8BMkHsU9Qm0/lqqz3YFFsZ5OBal4GVaUzEAhOIqqrKdDhk1CswjQEECOAGIgu09aXkC5Vw9j7drEEjAG/1FPMAw+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mkAHvpeljn8lfeXvcbyukgs8tse1A3586IDExXCv4HE=; b=w1SmI2i4mZbQKuOd2/Cr/ozoIj0Nnb+Tk29SVj1T7qQoozd45v1u4hwKP9MFjPO30L0VBze59TkyQ1UWYtszvdqBMnVTL/9dq2AYbP9GlAEvmJYYzyKpVHJTC6EkZv+AOlZ1p9ODdFUxhAS2/S9A3WiN8hMnmpuBJlwixY7RdB0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH7PR12MB7186.namprd12.prod.outlook.com (2603:10b6:510:202::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Thu, 8 Feb 2024 14:45:06 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f%4]) with mapi id 15.20.7292.009; Thu, 8 Feb 2024 14:45:06 +0000 Message-ID: <3f88502b-2434-4ed2-a3bb-8fde626d44f4@amd.com> Date: Thu, 8 Feb 2024 14:45:01 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] app/testpmd: add size validation to token parsers Content-Language: en-US To: Gregory Etelson , dev@dpdk.org Cc: mkashani@nvidia.com, stable@dpdk.org, Ori Kam , Aman Singh , Yuying Zhang , Olga Shern , Adrien Mazarguil References: <20231111071347.71824-1-getelson@nvidia.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE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tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20231111071347.71824-1-getelson@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0260.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8a::32) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH7PR12MB7186:EE_ X-MS-Office365-Filtering-Correlation-Id: b573929b-78d5-4c47-c817-08dc28b48a7a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WEBilDA/LC+WIHc2xr3B/dFzwgn69pW9+rxpZNuSsnXcyo5acyEV5bqR7fnQRAjDtr2dc8ahSNGOTZN+oBZpVRiggiGOnC8knzbDT0FLJyB4emC+b0MoNbeIc9Po6GCYcnFS9XLqmMdtg6o9DyHTLRFXc5Qb4SDr8KPQ0kODTTsdO1kM4pACKyELTrVIfZKzxrPLRDC2nC98u1TwMcZqOQII58DJ3bU+389eSydBe4BspfFiBUqnHUGpOOLtg6AEHFf5QBvCBe0wP6udKBTF6fWp+Wq1j5HSEyUVEs5c1DLTuDml/zE7/xIbTQzAewVoxsG2gzmb9RRm3LzbrYfI6j6n9XV+d95kWpcnMfcE6DFbxI72hIKDR9TDji0nMdIgNVJwI2ud5TVXgjds0iYLYwpr0mMaWO5wGkA5QOUqE23Li4OhvSi5stsiK1RkBlymjdg0aFrJejV7SQJML7j3XkRUjSRN82VjhZCPGnVPfr/hrS6Dj1Xfvhmo4HbnwG53bhECP3s8Te1lASnDdyszOKAksL02/c7bcdDVE74+VztTD6YsivVeoLtgdDaRSYyN X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(366004)(396003)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(53546011)(86362001)(6512007)(38100700002)(26005)(54906003)(66556008)(66476007)(316002)(2616005)(478600001)(5660300002)(44832011)(6666004)(8936002)(2906002)(4744005)(66946007)(4326008)(6506007)(6486002)(8676002)(31696002)(41300700001)(36756003)(31686004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QlQ3V2ZXRjNoS1ZQOTJJUVRqU2tneDlmQ3FuOEtTQW44c3Z0eVRseVp4ZUFJ?= =?utf-8?B?SzNmV2tIZGk4SFNvSUZlb2xiUnVKL1BoTndBNG1NdzFRTmJkRGMrSVJ5R0N4?= =?utf-8?B?UVlxSXRRUEFGOEVSL0wyMjBCNzErYWtYc2ZHNjl1Q0NrOHI2Z2lFZkZCeFMw?= =?utf-8?B?M1daeE1pcUNKT2hIbXpBckRhNnNIYVZialFPV0lHdlZTbGJrZTR4bUNpbytY?= =?utf-8?B?eDJDd0RmUXVZZXg2OGIzMEZBcVFQalZJS3FaQ0ZmWm9ldjlwWlZBZWRtQjZI?= =?utf-8?B?NXFEZURKaWpqNW1hYitHbkl5QWQ2NERuem8yRWg1RmxrUEhUbEwyMHY1OVl5?= =?utf-8?B?R3dRZ2hyVEthUUMrWU83Z2lLYjZXZTFOQW5jSTA2amswdUhONzFCSVB3OWxQ?= =?utf-8?B?cTdTZ3VTd1d5dmswT3BXNDh1T1hQbHBPelJzNHE2U1JhREFZQUR2VmwxZ05G?= =?utf-8?B?ektnRGpqMUNQMUtGNXdNbUNzOVJhUk5QRHVUZ2R4b0VKSUdIMktYOUJueUkv?= =?utf-8?B?YkQ4UWVGOVRDUjVOQUs3bHpwVnl1bVFNMjZ6S1U2dmIvMTFGa3NPQkROQW43?= =?utf-8?B?VHZzdWFRdjFB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UTYvUGxJYkc2R0JNREx6cHpNaFl2TDRhNS9NNnNFRnhtMlpHSTVO?= =?utf-8?B?ZzdoVng1dlhaK0ZHNU1xckJZYisxdkgrV2pKZklJWE5sdnB6ZkhnQTlETjFT?= =?utf-8?B?T05VeEZKUDdIYjduUEhBOTRJSGJvcVUvYWd6U1N0Ri9WNWo4NDJTYjN2aXF0?= =?utf-8?B?NXRWR28xcVZsM2R5ZGp6TW9CL1grRkhhZTZ4MEFvaklQNXdnSnBZeDcreVVD?= =?utf-8?B?M3R5Z2pCbXh4eW93NXhEWnZSN081REtjdjBPUVZRNDFMOHRhaHpQVzZheitZ?= =?utf-8?B?cG0yRGo5UzdiemF1eWt1bVhDT1Q1eUxQSjN6bitrL0xiTlhKbGFhYWVhV29W?= =?utf-8?B?QkQzMys0SVFDTkpUaWRHTnJxWUVQYmVYbitYakFKWTh1TXpVKytYT3JaUlNX?= =?utf-8?B?L3I0WEtaSU52eUJJYVFOVGIreGtQOXdpdGVoeWZvcXdxVTNkZlpzQXUyMGVG?= =?utf-8?B?TWRxMFBqL1Y5LzhZU0VPUjNzYlg4SVdwMWlCUWtsOTJVRWN5UjIxd01uUTJh?= =?utf-8?B?MW54Vk1zc0tBV3FUSElZM1dXSDB1Q1lZbVdSeUtBajlHSTk1OG5yMldiTG1k?= =?utf-8?Q?NfSxEJCob8B5A38aEfM9UYRWv?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b573929b-78d5-4c47-c817-08dc28b48a7a X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2024 14:45:06.4728 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NILdobixkQgtDsfM9bH055cVnga9pb4Didz5VBIW5K8RLVvEmxXRqn0f4EhD6OHl X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7186 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 11/11/2023 7:13 AM, Gregory Etelson wrote: > parse_prefix(), parse_int(), parse_mac_addr(), > parse_ipv4_addr() and parse_ipv6_addr() unconditionally overwrite > the `size` parameter with token size. > The `size` parameter references a buffer where the parser functions > will store their result. > > If the `size` value was less than token size, parser will corrupt > memory outsite of target buffer. > > The patch adds sizes validation. > > Fixes: d3f61b7bad20 ("app/testpmd: add flow item spec prefix length") > Fixes: 8a03ab58cc0a ("app/testpmd: support flow integer") > Fixes: 6df81b325fa4 ("app/testpmd: add items eth/vlan to flow command") > Fixes: ef6e38550f07 ("app/testpmd: add items ipv4/ipv6 to flow command") > Cc: stable@dpdk.org > > Signed-off-by: Gregory Etelson > Acked-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.