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 EAA86A0C4B; Fri, 5 Nov 2021 15:37:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D50CF41134; Fri, 5 Nov 2021 15:37:09 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 5391F40E5A; Fri, 5 Nov 2021 15:37:08 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10158"; a="255557717" X-IronPort-AV: E=Sophos;i="5.87,212,1631602800"; d="scan'208";a="255557717" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2021 07:37:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,212,1631602800"; d="scan'208";a="586371842" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga002.fm.intel.com with ESMTP; 05 Nov 2021 07:37:06 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 5 Nov 2021 07:37:06 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 5 Nov 2021 07:37:06 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 5 Nov 2021 07:37:06 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.49) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 5 Nov 2021 07:37:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nkL7jOk08mkvurAuzsuHCvAEqzBVEh7sySY+lhn7fP3U1nG3kmfyD5WcVaCfXVOw5F5fgBHkVdIMsCaKuP8jNGGsGvc8tEXzrSY2wm2njBaBHg1XGJj3UNzWZAJ0KhJsvjolYwkmbQbVY1suZZihx6YU+qbV865kSFGGCOpp5G71GJQj19n1cnou2Cz3+KzhYYi/MHLyX05MId4szSMWX/cVZR2CzdjswfY/+IeOs1TydJkdBsD84YqlVbPqJMRJxsD9u38xfGfkqjIHKVJe5SOBXhrRY0uLbYU7jzBnYoplO6OurvuPrRPDT53Z3Nu1InhiGCOOsOCQ2HUgW0l9rQ== 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=MRMgD0mLhpcV3PocC/iWjVvpYspF+lL5jnT5lZ1fN4Q=; b=Ut4cyzZVfUAc7iirFEAnBrw7k7bcbCfEdCFZkd7TCDBM9NX56KlpDwAmsYMCYORqX+ZRK5ezXJtIrWIS+2CbSlCjfisxs+hKM/c+62QGpojPxFYbBxQz8fHAEAKIfj9P/YJovIVYZPbBzU4JKOPMftX3ZG9n/EreVliSFjUUHtYkjXSVlwjTsSCD32+vFT5sQ02LhIlonxcISG6gRYRDM/fnD+oC5knKquoMuLkeeaJOP+WCfz6IuIVBpwjknzEQIz8kGV0Y0P026TQsJoqfGBGzR4+xxrVbX4mbz3AwAjnXmKXDVrN2li/KoNwUT4UEA8+e69hg5arugvSLj2fkgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MRMgD0mLhpcV3PocC/iWjVvpYspF+lL5jnT5lZ1fN4Q=; b=HgCWFZpg6mful5l6OFxvIeAhuGzDxK3dHWhLzy8JQTSkN43HmHXW7sQdZxSvnE0XG/KufFlq4hnXMmpnDPjY6BfT2YYSIJGeXSboT6FIrRZbLRLbmy2y4lzfeHipBYrBfw70K8oQfbkY2/cuosfWgyn7W3FCNmazTC8U9iB5PBM= Authentication-Results: oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4950.namprd11.prod.outlook.com (2603:10b6:510:33::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Fri, 5 Nov 2021 14:37:03 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%7]) with mapi id 15.20.4669.011; Fri, 5 Nov 2021 14:37:03 +0000 Message-ID: <0bb4b17c-dcc2-1171-02c3-0daf56824fea@intel.com> Date: Fri, 5 Nov 2021 14:36:55 +0000 Content-Language: en-US To: Andrew Rybchenko , Thomas Monjalon CC: Stephen Hemminger , , "stable@dpdk.org" , Matan Azrad , "Xia, Chenbo" References: <20211102234434.2639807-1-ferruh.yigit@intel.com> <20211104110422.2920154-1-ferruh.yigit@intel.com> <2458714.jUUgoNLaax@thomas> From: Ferruh Yigit X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0466.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::21) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by LO4P123CA0466.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Fri, 5 Nov 2021 14:37:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bc7ccfc4-b0c3-4d39-f01b-08d9a069bbd7 X-MS-TrafficTypeDiagnostic: PH0PR11MB4950: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q4EUIrSwsxBXQ7BfcLYS6FrQ5WlaQTQkBFqy/wVu/8Yu/38bf6YagXz1ChKiNEGJjn9GzJDpjfCt47Gnfy5hqKYhvRpuo926tWCURu6D3id7U+7QAns8L+fSgWwmg2j7r4WiUNKkpS8hPiqWTR5DGXTrRSsHp9uPLPbaE0BXgh20F/W9JhZYXstx0aAfHSJ80pZV9PY9Et36fkEoko7rSlvjHMGpB0sWNLp3WrAB/+yVXi/WzlLtUNWG+T1yAh/nDfNONLQPNsU92qwBSTpk+MkI4WKnAJb5EwwhbfliZtr7ec6qTwZyAc0WxK8OwNt8gYmu5tcFEen5Jbvf+aG68Ru6GV0rQ3nYP4aJnA59cqYNmhbhRvy7gj3EWen5QH9YTnTNzGhpB523emV8O04FRrgBeD2YDAuTYur1Pd9W58A2kI2vBJ5+HlJ/BAzCkKTS6kWeI5qfl1DwtMTZD7/HTJrHJMPoswgu+UdRKMyzfwaPuIFpgxKkALe8PBkMqAhFBNfbBhEpouXTikH+/jOgjRdbpgae2/zzO+NPwEb9dAhFScxpPDoM+rdUO5Vnc6y6ZHGNf/b43qKlnFKFMRpSuThLKj6kh845WirqC93XgOZLELzj4DZhb3rLD+EgSlaREUUgDQS++RCf4Sb+MlRfn2mv0wzJ4QkTvnZ0Wj27UtSYSe08Bf45Rwxl3NrcFc8ex2M2YGH4O9YLQYwnjtnHVA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(66946007)(31696002)(53546011)(5660300002)(2616005)(66556008)(66476007)(956004)(44832011)(2906002)(83380400001)(82960400001)(38100700002)(31686004)(36756003)(107886003)(110136005)(54906003)(6666004)(508600001)(186003)(8936002)(6486002)(8676002)(4326008)(26005)(316002)(86362001)(16576012)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MFh0QXRqbGEzSGl4RUtiTVMzNTd3Z0d5MG5wclQwU3NKc3FzYjNkUG5uM3BF?= =?utf-8?B?QTJpWGNCNFJvUUpSOHcwUndRaWoyOTFFd2hoQ2VVOGhobnZpT2FtdThTa1Iv?= =?utf-8?B?YS82NHBrOE5HTmg5QUhCcFU0WllMQjZPWllWV3VYQmpvMHJiOHBaMm9SYXZT?= =?utf-8?B?RXJJZmFSeTQ0Um5xcFVQbEpPUVpnQ3FHdkE2STJUZ2VETTZYWkV1dHV2S3pL?= =?utf-8?B?MlJXd3hsZkdPUHNzT0F0SGVad2daQzJibEd1aGxrY2JwYTFaQnFzd3kwN1JQ?= =?utf-8?B?QW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L0FnTVpqSU0vUjY2?= =?utf-8?B?ZS9wOWxIVUt3SHY3QXRERWRXOTVpNWFvTktONzBDakJ0OWdQSm02cjdjTU45?= =?utf-8?Q?I/TbeGC8qLgLO4VSOuLGTNU=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: bc7ccfc4-b0c3-4d39-f01b-08d9a069bbd7 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2021 14:37:03.5466 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f8ufbU4RXVERLkyty4ZUz+uyb0JAtcu2kgG7C6lSztpor1PScwynR6RKw0km65yF7m8goh+wDBD/sruOOI0IFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4950 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] ethdev: fix crash on owner delete 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 Sender: "dev" On 11/5/2021 1:36 PM, Andrew Rybchenko wrote: > On 11/5/21 4:16 PM, Thomas Monjalon wrote: >> 05/11/2021 04:03, Xia, Chenbo: >>> From: stable On Behalf Of Ferruh Yigit >>> >>>> 'eth_dev->data' can be null before ethdev allocated. The API walks >>>> through all eth devices, at least for some data can be null. >>>> >>>> Adding 'eth_dev->data' null check before accessing it. >>>> >>>> Fixes: 33c73aae32e4 ("ethdev: allow ownership operations on unused port") >>>> Cc: stable@dpdk.org >>>> >>>> Signed-off-by: Ferruh Yigit >> [...] >>>> @@ -757,10 +757,13 @@ rte_eth_dev_owner_delete(const uint64_t owner_id) >>>> rte_spinlock_lock(ð_dev_shared_data->ownership_lock); >>>> >>>> if (eth_is_valid_owner_id(owner_id)) { >>>> - for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) >>>> - if (rte_eth_devices[port_id].data->owner.id == owner_id) >>>> - memset(&rte_eth_devices[port_id].data->owner, 0, >>>> + for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) { >>>> + struct rte_eth_dev_data *data = >>>> + rte_eth_devices[port_id].data; >>>> + if (data != NULL && data->owner.id == owner_id) >> >> Indeed the NULL check was missing. >> >>> Acked-by: Chenbo Xia >> >> Acked-by: Thomas Monjalon >> > > Acked-by: Andrew Rybchenko > Applied to dpdk-next-net/main, thanks.