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 4229D41D9E; Tue, 28 Feb 2023 16:01:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC3B4410D4; Tue, 28 Feb 2023 16:01:14 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2049.outbound.protection.outlook.com [40.107.92.49]) by mails.dpdk.org (Postfix) with ESMTP id 0028D4021F for ; Tue, 28 Feb 2023 16:01:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LFnUFm75txDUDc8YrvB/4g91qurZyROgWKBSOkjyKNlvBs2auasoVgFYQXBc8hjgNph0i/t4vC2nw2mT3KE1HJ5qmlbm/rRT5Rz63EBVkqI7yrg8W6FIfTGkIWVYnhkTf5AGsmZjIEfO8e2fjurnaVnuUZwollgB6zvmM07OkP6XK0j1wi+Psx0BBgNQ3nrwgaCFjvR20t3fXeYUm7/MIauGTXQaE+lBozf7PNiNuRosdnTNLc7q6toB6KMzZ8INLbfYiMthPp+sD9ouTl3DKcHPyn7ZpAN1+tub1Dg6wDErvqYDzghU03cjo+L/HIBiCWNPB9oqVzkRkRRfoo9pQg== 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=AJ8GKCs5o9Z+0l/ahNKHKoUY7m151PlbhYFJWNQATbU=; b=NYLYv6DK2pEa1f03wPovb0JBqh/YQt7jYwvttvu+Zc6qJn82Wg+krrBx4JoZEyahkRWX0N42S21X03F1t6+IIfFnFB0rAY+9FYP9T6CZQyiLjnDRDtLsl2Rs+BTAgD20IrsEi0Adq0y5QX/13bA7TWizxzMCA+Lx1s/OLx+zWUusNpP3/tClZhBwrK78wiNcUTeHjr74BmDdfKh04KHc1BiMiEO7VeG3IwiiUREDxohlaW/b0OsBHfnlN0tx10P4bG8+DxjLWbl7CoVLBPQybodD/dLlAX/19W6oYO3Y9XsSeFYuORWDlgS1IxPiT2XOqPDSiotu8uyyhC8Rce8Keg== 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=AJ8GKCs5o9Z+0l/ahNKHKoUY7m151PlbhYFJWNQATbU=; b=IliHWFl+E6Vmh50TN8fb2RYDqEJpEstYqi0P/TqmzH98LwOWx8wkVJ1JQ04ZbKabJXF8GvZnhikxBwX3FOqCfgq/hYzgHlwa/tt8THALLvamPTbBi4NmrB2wwwfhh0BReCpRTNlxM5zy6IZUc1NbRvb/X0P3hlNMRYViaytiGRM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN2PR12MB4301.namprd12.prod.outlook.com (2603:10b6:208:1d4::22) by PH0PR12MB7838.namprd12.prod.outlook.com (2603:10b6:510:287::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 15:01:10 +0000 Received: from MN2PR12MB4301.namprd12.prod.outlook.com ([fe80::80ae:e5ed:4fa7:2ad7]) by MN2PR12MB4301.namprd12.prod.outlook.com ([fe80::80ae:e5ed:4fa7:2ad7%9]) with mapi id 15.20.6134.030; Tue, 28 Feb 2023 15:01:10 +0000 Message-ID: <5b714a8e-1851-d204-18bc-6fe9cd5d5afd@amd.com> Date: Tue, 28 Feb 2023 15:01:05 +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: Ankur Dwivedi , dev@dpdk.org Cc: jerinj@marvell.com References: <20230223123029.2117781-1-adwivedi@marvell.com> <20230223123029.2117781-2-adwivedi@marvell.com> From: Ferruh Yigit Subject: Re: [PATCH v1 1/2] ethdev: fix null pointer dereference In-Reply-To: <20230223123029.2117781-2-adwivedi@marvell.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0099.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:191::14) To MN2PR12MB4301.namprd12.prod.outlook.com (2603:10b6:208:1d4::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4301:EE_|PH0PR12MB7838:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d69a0dc-4897-4d9d-5197-08db199ca02d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K7rhEkgSIYfxtV30mTt1XYjCUBmUIE44t4N9uVRxzhZcH8eNfmpQk8VEcLNXCJB+Hd1G8ge/auOwu2UgPKBnYgXAU7bhaqZbBLTvruYP2Gz20J5DUSTueyd0jEfF8nRsbJKIWexbG1Yx/+5P4G0vLrFfioXAx1mNqVITjB23EPg8+m/LuOOml+nfMMZbUGo9VOS7OKDKh+MY2YNejTOPt+sKYnTKbUVmQZARI9FdSwvZZrMtAM3XTPjMIzFXClQgL10FtN2n0ZT62iYRpzL6froChZwRs/QgO0V8MfDn/vF7hFZoOO0WFCafZq1UrMu/8bg82/pHZnnHmuFKKdO6awfSrNchGavRMM9Rdh4fgLmS/g/Q5BaG3wEQPs2O0guC4xAQvnxyqPqw+HYXz23YjEQZpg26laT+GkWNT21e53FDtz6yYqGw81KKkbfzdxGazwBAbDkY/bXq6m7blxo15sNF++U+VzLHqUthOEJGVeF2RZR0FLugFrqPEg+SJ2ofMpRashNh/lBBfvJUu+9wqGxf0+DPYgwDpDQdqXHvn37sKWos6G0evdIrE3H7TiZ0Sl7wL2ibrYpbrPSDIrTqunJ0zzJPtE4byjsPhsB2PAGEPX0Ok+MQfU2TYiNztDc8Zrywy/mVGpHWLELBUI0lvOCp6vXUznX5uIouLXPuJKGM6ggGkM9f+cbNy4xuwhEUGqe5yAl0acEQenWDpBcsgGaZLSJVZYZbdc7a13Ukzvg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4301.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(396003)(346002)(39860400002)(136003)(366004)(451199018)(2616005)(38100700002)(83380400001)(36756003)(6486002)(2906002)(6666004)(6512007)(53546011)(6506007)(478600001)(26005)(186003)(31696002)(5660300002)(44832011)(316002)(31686004)(86362001)(8936002)(41300700001)(4326008)(8676002)(66476007)(66556008)(66946007)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cnE3NjNOWTBFRUJ6SXE5TklpNGJMcHdGRGRpRHlCSW1lMXU3ZnFLNjI1QS85?= =?utf-8?B?WTZ5ek9CUnBBMFJ3TGEyaVYxN1MwbjFEOUFjcDFncTE1b2lFQytSZGhRZnQ3?= =?utf-8?B?V252LzY4K0dTZm8vOEF6ZXJjZVFxYWd3SkpKNExtUllqTmhKZ0RyQU9CMXNH?= =?utf-8?B?QjI0Z0JwelJ2dExQZUVYc09DaWRUN0pCZW9HTEtqR0FCMy8xaExEWVlndlJZ?= =?utf-8?B?SXpqT3YySXBJK0RrSXlpUzhyNDByYjJNSDA2V3F3YTF5cDRQaWRncUxjU2Ra?= =?utf-8?B?dWV2eDlVaCt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t0MVp1Mmx4TzRwV0Q2?= =?utf-8?Q?/qTwDhyYNwvlOcJ+XgRkGoOQ5?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d69a0dc-4897-4d9d-5197-08db199ca02d X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4301.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 15:01:09.8630 (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: 9q15lzgbyYc2MQnc9UTetQlbhd1vxJo4iSEJ5wYhUJDnunXzsrXA5wU1WUWCJHF9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7838 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 2/23/2023 12:30 PM, Ankur Dwivedi wrote: > The speed_fec_capa pointer can be null. So dereferencing the pointer is > removed and only the pointer is captured in trace function. > Fixed few more trace functions in which null pointer can be dereferenced. > > Coverity issue: 383238 > Bugzilla ID: 1162 > Fixes: 6679cf21d608 ("ethdev: add trace points") > Fixes: ed04fd4072e9 ("ethdev: add trace points for flow") > In below changes, pointers can be NULL at runtime, so agree on to the change, with minor comments please see below. But I don't think this is a fix for Bug 1162, which is an ASan reported error, can you please drop that tag unless it is verified. <...> > @@ -2308,8 +2300,7 @@ RTE_TRACE_POINT_FP( > int ret), > rte_trace_point_emit_u16(port_id); > rte_trace_point_emit_ptr(flow); > - rte_trace_point_emit_int(action->type); > - rte_trace_point_emit_ptr(action->conf); > + rte_trace_point_emit_ptr(action); > rte_trace_point_emit_ptr(data); > rte_trace_point_emit_int(ret); I think 'rte_flow_trace_create()' is missed, rest looks OK. Can you please double check 'rte_flow_trace_create()' too? > ) > @@ -2349,14 +2340,8 @@ RTE_TRACE_POINT_FP( > const struct rte_flow_indir_action_conf *conf, > const struct rte_flow_action *action, > const struct rte_flow_action_handle *handle), > - uint8_t ingress = conf->ingress; > - uint8_t egress = conf->egress; > - uint8_t transfer = conf->transfer; > - > rte_trace_point_emit_u16(port_id); > - rte_trace_point_emit_u8(ingress); > - rte_trace_point_emit_u8(egress); > - rte_trace_point_emit_u8(transfer); > + rte_trace_point_emit_ptr(conf); > rte_trace_point_emit_ptr(action); > rte_trace_point_emit_ptr(handle); > ) This change is different than others, this is removing bitfield related local variable assignment. According to bug 1167 that is causing a crash. So we need a separate patch to either remove or fix bitfield related issues, for now I am OK to remove (as done above). But can you please make another patch for bitfield issue and move above change to that patch? Thanks, ferruh