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 6EB2741EB2; Thu, 16 Mar 2023 19:20:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B77840DF6; Thu, 16 Mar 2023 19:20:10 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2077.outbound.protection.outlook.com [40.107.220.77]) by mails.dpdk.org (Postfix) with ESMTP id 5AB0E40DDC for ; Thu, 16 Mar 2023 19:20:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cuoamtamIeSu0I5xFEB38pm72aA2aM5A7wn6+7bMo9p9xaeM5oRzmsvJwvDYuRMZ6nbz3IWvC3cC/sZ12sbF2Pi5HrpPC2FnGg7B6JHvLTGKOXaPDTLN/4dGH/TCYA5MPTjjpZ5BCpdFBn04hLF4pRFl36TS2k9nFGgoQlpRs8v6iPUM6CNlAxaZ8U21PwNujlJ9+TzARKDji78WHvSm92J3hBKJBfO2XpOtzqdfMGyTPY4hszTpLZBMMEzuk+Bg/1MMbIKg2kUTmoA8E1h7/kr9+ILajIKu5KWagEtAeiyuZxliSBsgGtJpFUlaVtwIc2xWsyb6OhFJBpoIKjHNeQ== 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=3x7bwl+wRHehGxCZ6fPBJdwxOt5FDrq4cvBUr/QXBXA=; b=MJc9DNTQvIvmRGxeobwUvy0MkDNUDcfKl4AEA0qLtJsY+INQAYzfCyhnDTRAoIaudN3k6+TN5/AStaFcWrZshMwUNTjY6eiIb8lKgj5Dp9A3gT1vRECh/VWlPX9eoIE/K1/U5hot+rHj63Hpio2JR3tbB2q36EjiAQQ4dq3Wh2c2Z97vqueL/AMkfi/jUnAe20asFqNLt1KEIOPrW8H7kwhV0aYwIMdyYvSD5fd6ydB9pIje/xRI8c9HqpOHhoUZnSNnggT1shNaWsoU/eDBjzIbMt/C3cnOgLq/RdZep2xMq3ibElMrxLzQDaXxGmFw7dYR57wwsxEoEeegkXC+OQ== 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=3x7bwl+wRHehGxCZ6fPBJdwxOt5FDrq4cvBUr/QXBXA=; b=sl4s7V7pPxxZgPUa4YiWENcOtFgOLjWVtE4kXyQzOZHMBx+zEm0Yyr7DfB/FEc0cWe0UQ2hWQ9msO93HZkOgMlO2/klNFIWIFpdYe3LLd7PqnvTJwL7J9mDpcW953hhOSyQBhgprQiC8T37gY1zbBsRxLZwaqO9zn6JuWNN8/+Q= 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 PH7PR12MB6420.namprd12.prod.outlook.com (2603:10b6:510:1fc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.31; Thu, 16 Mar 2023 18:20:06 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%5]) with mapi id 15.20.6178.026; Thu, 16 Mar 2023 18:20:06 +0000 Message-ID: Date: Thu, 16 Mar 2023 18:20:00 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Chengwen Feng , thomas@monjalon.net, Jakub Grajciar , Ferruh Yigit Cc: dev@dpdk.org, Stephen Hemminger , Andrew Rybchenko , Olivier Matz References: <20230314124813.39521-1-fengchengwen@huawei.com> <20230314124813.39521-3-fengchengwen@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH 2/5] net/memif: fix segment fault when parse devargs In-Reply-To: <20230314124813.39521-3-fengchengwen@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0563.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:33b::11) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH7PR12MB6420:EE_ X-MS-Office365-Filtering-Correlation-Id: bd4f53dd-7339-47fd-5fa4-08db264b114b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YsAyaTrPqeXdc4UO4dxP0DDnOI7mQlBL6E1UdAYMphRaTHNOubkz1FJL0WRljdo7Muh9a4MBAhK023t3jQOv0bwRS/a/MfC5AtkMNafNs+/enkpuuIh68QDe6+WLeJWxHmIu5vJI3EKYGK5N/VVSw1Sa04/gozAeMSt6CBnvmfaWJ1Bm8RW/8TYddONS9uHUEMCJfJmZL0EKprAGSmJYU8rRbWhdLHVWAjcyCjdCa3ciRxjAs/+Q/3fiDT4UzYx9wUz1WXU1fZfjU68hmNEotfqfRTv7FLcBD8jMZLnM6H3C+DJQldX29kKSLqU5UI3v3DlxvE5cSQo/BduQm+DKP4ClitiChulERpUED1MxoXHNc5O3F21M1IBEwwPvFdNQZrB3rp6pKeWR7vQvHL2tIZdjWNgbZq+zbOtPC33myDYscnAO8zcDcd3skAiXNjfMbtO12lT94geypsQw+K9TWblGO1Deg9jmvoFwW3DrSvNNoipKmP5jVzteoRgxWWnLxxsCny3w7SwJCPyg956QIkFrVBiXbAaWLBJGfkykbNPTTfgvqmR9m6OC8JXhFik28W/VoRhy5F8Kd5xg18yoAsDLIMR59jK6KbLjYDh5q/1cfaQGTB3G9L4nHRUXPEMv0cGMo56aDOq7iFlNz/4+x3le7KPJyxq23UyOzxYlcWnVe/TYXbNKC4bWQQtBaowl2+UpBiYleMkpqAHZmKxlfARRa1zwueANWc624+XBXas= 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:(13230025)(4636009)(39860400002)(346002)(366004)(136003)(396003)(376002)(451199018)(66946007)(66476007)(36756003)(8676002)(4326008)(38100700002)(66556008)(44832011)(83380400001)(2906002)(2616005)(6666004)(41300700001)(6486002)(8936002)(5660300002)(31696002)(26005)(53546011)(6506007)(186003)(86362001)(6512007)(54906003)(110136005)(316002)(31686004)(478600001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S21rVFRINUJXMEplK3BFcXRtQjBrR1pDSy9KWGVTUjI0TVJ0amI2bVJoMjBw?= =?utf-8?B?Rksrc1BTcXFPVG9XUytWdW5UcEhvYVhoZVVPL0RWZFloTE5mQndPeXNUVkhm?= =?utf-8?B?SXlWZCtYSjdsK3JpS3VjdkQvL0QxS2VEVnhQcHJpRXF0R2tQM0dZWVd3RDVW?= =?utf-8?B?N1FYcjFuVndyQmEwMDZTdGVpb3hqbEVQa0h6aFdrNjZFZ1MyNXU1WUtlcVdm?= =?utf-8?B?Rk5Rc1VTNU1hSkx0UEdVRmI0RU1wSWljM3ZBMDhxZVNMeVJJbH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ErRDdGSlJRRzJCcXIxTzU2NUhlaTllT3Rjby9XZFZX?= =?utf-8?Q?ljbaU0QZEuKG6Snkx5KXb6QJ9?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd4f53dd-7339-47fd-5fa4-08db264b114b X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2023 18:20:05.9643 (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: KPE83R1cwP+4iniIR2axkSflY178zC0fdyXthfmE1jkiywB8VskAuzF7V5vgGUVr X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6420 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 3/14/2023 12:48 PM, Chengwen Feng wrote: > The rte_kvargs_process() was used to parse KV pairs, it also supports > to parse 'only keys' (e.g. socket_id) type. And the callback function > parameter 'value' is NULL when parsed 'only keys'. > > This patch fixes segment fault when parse input args with 'only keys'. > > Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD") > Fixes: 2f865ed07bb6 ("net/memif: use abstract socket address") > Cc: stable@dpdk.org > > Signed-off-by: Chengwen Feng <...> > @@ -1889,6 +1913,9 @@ memif_set_mac(const char *key __rte_unused, const char *value, void *extra_args) > { > struct rte_ether_addr *ether_addr = (struct rte_ether_addr *)extra_args; > > + if (value == NULL || extra_args == NULL) > + return -EINVAL; > + > if (rte_ether_unformat_addr(value, ether_addr) < 0) > MIF_LOG(WARNING, "Failed to parse mac '%s'.", value); Not related to the patch, but to record it, it seems public 'rte_ether_unformat_addr()' API is missing parameter verification, we need to fix it.