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 AF062432E6; Fri, 10 Nov 2023 15:52:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68D8B40EE2; Fri, 10 Nov 2023 15:52:02 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2067.outbound.protection.outlook.com [40.107.223.67]) by mails.dpdk.org (Postfix) with ESMTP id 190C84064C for ; Fri, 10 Nov 2023 15:52:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=knc7tjl3qTHraUohPkGwxzkagxx45ScUmk0LZd9U2Vatzi9iBtqfCwdxFF9rh93KCcjQXtC7NjKVT4wQJ3F5lknzZlu7Xe83DErGlx9QDInOjc0bhCUteOd5YFLaO+eCQR62GN62lDPtzBi3thLMw+IZyG5AEEgJ/qjwgUaFnysGWUzViA/T8Eq3LAxRZmap2LrQ9l6RtwyREXVaHt4s0IkQhUdQbMqs8ybOMFXRKIWRlCuCjGh751SsvEyDStbT0wwANs6Q17XnqpZYNF8gYnNWXnHbQRocW4q9jCvwjAyNpmeWYwmWGtwTp9bEsCf7oJapJ+xT0iq4mhyLOKtwpg== 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=pg7XAWRMFPEOKXwr4dw0jRD8RAV/ETi08TYuY1nyb+E=; b=b9BPeoEGHN8GM+ymjvdU7xlgWmrM3CfCvIFiU80ijtT3s1QFjxZDDIj9yT4+sOD/OD9kNznekg2SjPGkx5sj3DYgjhAarPNIIb2BdzWLXSQQR5lur4RLxbhNRzX7mwMqZCJwJIoBlj4fx7lAa32WAUx3dDYoNREIx+FhpyAI1EnmREvQ0YQ/7BNDdIF5XC3F7liZvunmDWYjmWqWfA3gZVCQEqnJBZvQP6Bi4vZ6BAooRMC3KobiSHqdmMMp6nTIHn1u85XvE2m79loS1aNo1aPsLXVs1KsF/jdlGCWJEsEqZHO6hsPRc40r1rnYZOMM/K39RK13a+UhgTBGOo7ojQ== 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=pg7XAWRMFPEOKXwr4dw0jRD8RAV/ETi08TYuY1nyb+E=; b=0yRPM+5j6WS4fb59HjxfQwQ79UTfcWZxO7z0bwdh7yiCh0oLFB8D2QXe/7yEAo3Ea1UFi5jWsAnZFt3CJS43k3MCPZmyA1mcvekEYXxZdeZTtznj+TmrvUm6SjR3ykaX/I8TWM8T2CZCMyJHLlOW5xCxcYK2p1vAK2rbFaNwEOs= 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 CH3PR12MB9024.namprd12.prod.outlook.com (2603:10b6:610:176::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18; Fri, 10 Nov 2023 14:51:59 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f%6]) with mapi id 15.20.6954.029; Fri, 10 Nov 2023 14:51:59 +0000 Message-ID: <95a14c2f-f6ba-4133-b787-99c2feb8739c@amd.com> Date: Fri, 10 Nov 2023 14:51:36 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] app/testpmd: fix indirect action list parameters parsing To: "Etelson, Gregory" Cc: "dev@dpdk.org" , Maayan Kashani , Raslan Darawsheh , Ori Kam , Aman Singh , Yuying Zhang References: <20231108163445.422772-1-getelson@nvidia.com> <9c982259-df1f-bdce-11ff-554831abc42f@nvidia.com> <01176d6f-7f4e-465e-b0e3-20dd6a7e6d18@amd.com> Content-Language: en-US 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 aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbA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i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR0P281CA0242.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:af::12) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CH3PR12MB9024:EE_ X-MS-Office365-Filtering-Correlation-Id: 42bdbe4d-ca8f-45a3-7773-08dbe1fc9708 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LuezNPqQK/UYa4coiw02PACwnf78A9Z047kNKJnkupRj9HlGf1S3PzlgblRTb32yi8fxbVGvnVnP337BiFwcViFl8JLrB0/kUBxO9GWApam4Jn+oaj1B2TQd1qKlxeI+GfNxx0D1T0Ril9a2kOrvEtX4mHA06PX6plsSXVpf4ySqysu37jjf4W/yN3DJrvW4wuXEd8LqEiQcQygDrRa1IGnjmELmRPUf77I6NaJsls2wtgpHDC4CzuS5VyostIACEkUpZOQIZYdLoY7mWgcgf935xectG/y4xGRoUPq++xUDS1MOFEWIxnQmiW3LFB7OcD7VBL16cmu5niJYqBOBv1nlLkwPcQcCL1nubGldg1lI53WbTvJmGzCOcTE9s7vxF3jzFDVJb07M9Cf2PHxlKXZ6kc/2o6/9aWHftzQYR0Mzn9I/eH4oGXDJ0aIpjc+tyv7NTksa5wU/qS2RmtErwkIje+V4cbAkZ6vayJbnfDjjqMYw32Q2Ikvj14bpEsMS069urwDox6j9V/BTL5wyMBAAiMfr66Ah2iFiE7jRrX9R+G7mcUizQbKUZ6oFbBoandy8pUa+0H/87Rq5yzAmMGeQie2Zt1Vr6s4hnsoJnrTGrIbwg75dZPCbalbPaPJhxJLT7c3S3uZFmZAGylgxEA== 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)(39860400002)(396003)(346002)(366004)(376002)(136003)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(2616005)(8936002)(8676002)(6506007)(53546011)(4326008)(26005)(86362001)(44832011)(2906002)(31696002)(6666004)(38100700002)(5660300002)(66946007)(54906003)(66556008)(6916009)(66476007)(6512007)(316002)(41300700001)(36756003)(31686004)(6486002)(83380400001)(478600001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K251TkoweHM3UFZBOUh3Ni82elVDTlBnRy9QbS9GNUtFWDBiKzhBbUFLU21H?= =?utf-8?B?NzRYWkF6S3YzZWRmeGYwNWdiTDR0ZXZDY0dSWUpmYTRHMFhNQjc5QWlhV09U?= =?utf-8?B?cDBjOUtGUzJhcWxySjByNXVpWGtCbElwOFFpYnloV3RDZWZtK1FmUFVqeFpx?= =?utf-8?B?UzF2anlRcmI5RjF5VkgwRWRTK0pGN2wwZ0QvWm1hSVdJSTZRZkIxSmRiT21P?= =?utf-8?B?N0xYZi9GTStkdU03N08xblhjS1pYS25ZYkgyTU1ObTQwWVBJek5RSnJFLzlu?= =?utf-8?B?cjVBWWdSQjZVYjF5ZCtUK29Ibm9KWDJOcllsMW84UTVZK3MrRjhoaDNSazlh?= =?utf-8?B?SkZaZlVMQmdBcU9uT01RTDZVVmRkNDFiZFZNOVY0Mk5NWGFuSmxBYlNrQ3VT?= =?utf-8?B?aWxtcmpOV2xXZ3RUckpreElWL2VEa1h3Q0gyWHpBb0FKMGdBcU5aT0VIbTNp?= =?utf-8?B?RzljVjBaNTFackpva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8?B?RU1pUkZkTk93U1RzTXN1NndFWXRZYlNzM3lsZzFRampNK2w5ei9seVQwZ29D?= =?utf-8?B?ZklPbWdVcDdKbWpRbjZQL05ucmwxVFBtMVhwZmpWcjJucEVrQ2VOU2NmMGNS?= =?utf-8?B?Zzl5djEvYUR1NHVEL3h5b3JHWUkwejR0cnV3ZXhZdFFWbXVFajY1Ylh2OUN2?= =?utf-8?B?REhLc3NoblRWRDh2ekRDNmxvQThnSkdRZndkdENFU3UzQktsWXJNMHhmV21F?= =?utf-8?B?ankvWExTK3h6bXhuVk1zM09OZFVLbTNrT1AzRUtSV3hFM0liQ0pRYmxpYjJy?= =?utf-8?B?U3JHeEZvUGU1c1E1N2VEQ0RIOXRxQndlYmNDR0lmazd4NGoxeVRvbGxHRXpI?= =?utf-8?B?NnAvODBhbEFxdFArLzJscU14RmdZR05PelFYNWJtVUFCSHM2cTZQeC9YaTkx?= =?utf-8?B?SW1iZjhPM0YxUEJLUC9aRDhwQ05UNFVwR1RHZFU5ZzVPV1ZDb3NCOEFkVWM0?= =?utf-8?B?YjdHbDArYk50RkRIVGZmeU45Q1NGc3V6allrSlVnVStXd2lPWFdlY1B3bmF5?= =?utf-8?B?N1hjTGxQT0xwZFBMZVpxdlhrVU9WY2d6dUpqRmQ1aVpwc2Vhc0xxUUNsVnA3?= =?utf-8?B?a3RWMVhtWW41emJxMnNOMzFIZWNNRUpXTmVZVXg1dWwzT3ZnUGVaUGx1YXlV?= =?utf-8?B?UnVmRVc2bmptTkNqcUZRT0RkdElnMVFIbXFKenF4MlpqclM1OGFNVldpZmNE?= =?utf-8?Q?VtlE=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42bdbe4d-ca8f-45a3-7773-08dbe1fc9708 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2023 14:51:58.9142 (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: IuAoZV28oym5+XrOpMJRM1kK0BjnMsQtOd7RIKEVypEbr58/sbREC62zQjluq8UJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9024 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/9/2023 7:57 PM, Etelson, Gregory wrote: > Hello Ferruh, > >>>>> Indirect actions list arguments parser was configured to place target >>>>> number into 64bit value, while the code provided 32bits memory. >>>>> >>>> >>>> Hi Gregory, >>>> >>>> Can you please give more details why 'id' needs to be 64 bits, with >>>> callstack or usecase etc? >>>> And please describe what is the observed problem with current code? >>>> >>> >>> In rte_flow.h, struct rte_flow_action_indirect_list::handle is a >>> pointer. >>> >>> Testpmd ACTION_INDIRECT_LIST_HANDLE and ACTION_INDIRECT_LIST_CONF tokens >>> define arguments size as uintptr_t. >>> >>> On 64 bits system, defining the id variable as 32 bits value >>> corrupted parse_indlst_id2ptr stack. >>> >> >> I can't see how stack corruption can happen, can you please provide call >> stack and flow command? >> > > To reproduce the crash buildtype must be release or debugoptimized. > The crash will not reproduce with the debug builds. > > Testpmd commands I use: > > dpdk-testpmd -a ${PCI_ADDR},dv_flow_en=2,representor=vf0-1 -- -i > > port stop all > flow configure 0 queues_number 12 queues_size 256 > flow configure 1 queues_number 12 queues_size 256 > flow configure 2 queues_number 12 queues_size 256 > port start all > start > > set raw_encap 0 eth dst is 00:16:3e:52:bd:37 src is 00:16:3e:6e:16:e0 > type is 2048 has_vlan is 0 / ipv4 src is 110.240.52.255 dst is > 189.68.183.147 proto is 17 fragment_offset is 0 packet_id is 1 tos is > 102 ttl is 189 version_ihl is 69 / udp src is 56800 dst is 4789 / vxlan > vni is 3 / end_set > set sample_actions 0 represented_port ethdev_port_id 0 / end > > flow indirect_action 0 create action_id 5 transfer list actions sample > ratio 1 index 0 / represented_port ethdev_port_id 2 / end > flow actions_template 0 create transfer actions_template_id 6 template > indirect_list handle 5 / end mask  indirect_list handle 5 / end > > Result: > *** stack smashing detected ***: terminated > > The corruption occurred in `parse_int()` called from > `parse_indlst_id2ptr()`. > > Inside `parse_int()` the arg parameter referenced 8 bytes of memory > while the target buffer was 4 bytes allocated on caller optimized stack: > > (gdb) p *arg > $1 = { ... size = 8, ...} > Thanks Gregory, I can see the problem now. if 'handle' is not an address, but an ID, your V3 makes sense to convert its type to 'uint32_t', and it solves to problem. Same for 'conf'. BUT back to the root cause of the problem, `parse_int()` tries to be generic and it support different size of variables [1], but it fails on this. `parse_int()` gets 'size' as argument, but it doesn't use parameter value, instead overwrites it with 'size = arg->size;' and uses this value, in this case when context provides larger variable size than what `parse_int()` gets as parameter, the problem you observed occurs. What do you think to use 'size' from parameter list, as it is intended, instead of using 'arg->size'? Or perhaps use 'buf' and 'size' from parameter if they are valid, else get the from context/arg [2]? I think this solves your problem, can you please verify it? btw, 'buf' usage is a little more complex, since `parse_int()` checks for "ctx->object != NULL" to continue, I can't really be sure about intention there, but please check usage in `parse_port()`, it looks like when 'buf' provided expectation is to get parsed value in the 'buf'. [1] switch (size) { case sizeof(uint8_t): ... case sizeof(uint16_t): ... ... case sizeof(uint64_t): ... [2] diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 0d521159e97d..cd123c69265e 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -10805,8 +10805,10 @@ parse_int(struct context *ctx, const struct token *token, goto error; return len; } - buf = (uint8_t *)ctx->object + arg->offset; - size = arg->size; + if (buf == NULL || size == 0) { + buf = (uint8_t *)ctx->object + arg->offset; + size = arg->size; + } if (u > RTE_LEN2MASK(size * CHAR_BIT, uint64_t)) return -1; objmask: > >>>> Inside 'parse_indlst_id2ptr()', >>>> 'parse_int()' can work or 32bits and 64bits variables, so that one >>>> is OK. >>>> But both 'port_action_handle_get_by_id()' & >>>> 'indirect_action_list_conf_get()' gets 'id' as parameter and they get >>>> 32bits argument, when 'id' is 64bit won't it will be cast to 32bits and >>>> loose data, should those functions needs to be updated as well. >>>> >> >> Can you please reply to above question, about changing 'id' type impact >> to other functions using it? >> > > I've missed that. > Need to re-think. > > Regards, > Gregory > >> >>>> >>>> >>>>> The patch updated variable size for translation results. >>>>> >>>>> Fixes: 72a3dec7126f ("ethdev: add indirect flow list action") >>>>> Signed-off-by: Gregory Etelson >>>>> --- >>>>>  app/test-pmd/cmdline_flow.c | 5 +++-- >>>>>  1 file changed, 3 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c >>>>> index 0d521159e9..cf1ca33208 100644 >>>>> --- a/app/test-pmd/cmdline_flow.c >>>>> +++ b/app/test-pmd/cmdline_flow.c >>>>> @@ -11331,7 +11331,7 @@ parse_indlst_id2ptr(struct context *ctx, >>>>> const struct token *token, >>>>>       struct rte_flow_action *action = ctx->object; >>>>>       struct rte_flow_action_indirect_list *action_conf; >>>>>       const struct indlst_conf *indlst_conf; >>>>> -     uint32_t id; >>>>> +     uint64_t id; >>>>>       int ret; >>>>> >>>>>       if (!action) >>>>> @@ -11350,7 +11350,8 @@ parse_indlst_id2ptr(struct context *ctx, >>>>> const struct token *token, >>>>>       action_conf->handle = (typeof(action_conf->handle)) >>>>>                               port_action_handle_get_by_id(ctx->port, >>>>> id); >>>>>               if (!action_conf->handle) { >>>>> -                     printf("no indirect list handle for id %u\n", >>>>> id); >>>>> +                     printf("no indirect list handle for id >>>>> %"PRIu64"\n", >>>>> +                            id); >>>>>                       return -1; >>>>>               } >>>>>               break; >>>> >>>> >> >>