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 CAC0645D42; Tue, 19 Nov 2024 13:06:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1EFD40268; Tue, 19 Nov 2024 13:06:23 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by mails.dpdk.org (Postfix) with ESMTP id CA0AC40041 for ; Tue, 19 Nov 2024 13:06:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732017982; x=1763553982; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=lKy3k1HJ7Hq+Xm2OWVYVGM2FVNHc0Mf5Qsz3BKA3Szw=; b=GycaH9/DxdFg132+HtFgeqU/Vd+ASWz9o22B/yCDosJ5yg/TEklyn/WH 8S5c0x+sq52LXyCZ6wqsOsWCo4fTamw7bdpjgtaimUxJvWYSseyIyOjyi zVC1xe8Bqbkt29hdiQlHok+KDshJSGzOH4e7xV+/Io2ipvJ2AQaSz+96S Ta3XYaiAbh3vi/e/VOMWUDo8xosuaBrC2lU5HpqfIKTkxa5ihVQYl5Ywy AKRm+beGiS7zOrn4yOK9szWI90awSHfGIa6oIgFal+vOP0PRHQM+X8wbv 5SHMgQARIug5zqpSEVfst1WeSPHH0+B4/SPFIuV5dBAIzT4OKMmKVbU6y Q==; X-CSE-ConnectionGUID: HjKbPlnUSUeNSCGAYdszeQ== X-CSE-MsgGUID: jjgUIwEyR3G7DO++N5PxHA== X-IronPort-AV: E=McAfee;i="6700,10204,11260"; a="43081171" X-IronPort-AV: E=Sophos;i="6.12,166,1728975600"; d="scan'208";a="43081171" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2024 04:05:57 -0800 X-CSE-ConnectionGUID: 9afFB3/wRYuAkWOhcgUssQ== X-CSE-MsgGUID: y8IVWPOAR3OfYmfG+JfXhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,166,1728975600"; d="scan'208";a="93606708" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Nov 2024 04:05:56 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 19 Nov 2024 04:05:55 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 19 Nov 2024 04:05:55 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.45) 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.2507.39; Tue, 19 Nov 2024 04:05:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l+4zJg1q5/H24Wso3pmKrHYO+BhoSTy5Mcqi1FU7XzYrrAL6jBDiXtmDhjDmZbH/qlOI3dol6BrdT4NOYvVrC9lOmRAKYg60d7YGk+ePc6ppf3rD0ejJxwPH5NH8Fb3VhCOcHbCqDMBmo6EQ0IyHJ05FeKjiaOJAjw+nkQF0AhdJ+leoTivex85Hnkihe7cQASbebXlyAYmNOeR5uGHSw1T1F0s2q8Fi5cyJsNclrXo4WmwL62f8F4fTJ3HfYjtNwCmPEKowSWi++7LAra2jhU0cXKGj45dE3bRc1SgVam7qN3VzZuCFyk1JSbiNC7sAjyZNN/kPYdm28nDBE8ijqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rgJIqX98a56wdaQtf5khfL0PbwihZT5/oS7LhTzpdnI=; b=mfUlCujHSEpGsRzUBd8Ag+N/ROie868AnRGNlUQY0f3hbgwnIFTFvh9KqwkOEiHCrspAwZecRrfQtYn2TUPjPSCMkydSH/rOfaS0CEr/xHjqBiuG5S9QY9Jnm+YmEU4elt1c65n4cT3J6jDExv1FK2tCsQRNJMAPFExg7TZRiIhn4xZMWIPg1jCWi64MjUJNRzCDPVkekwP57hjcGK+hi6CEpNoSdn+1t7eX7sdFvBWrjMBh/6b/RUsivXYMRdhAiifhC0tanhuwqbyY+lQUA5hhfZdoMtaGBUHuY9LGChhtgV/hvsNnQgkxQHv98AdM12D4AMYKFF/5O0AzDNmNUw== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SA3PR11MB7485.namprd11.prod.outlook.com (2603:10b6:806:31c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 12:05:48 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%4]) with mapi id 15.20.8093.018; Tue, 19 Nov 2024 12:05:48 +0000 Date: Tue, 19 Nov 2024 12:05:43 +0000 From: Bruce Richardson To: "Stokes, Ian" CC: "dev@dpdk.org" Subject: Re: [PATCH] net/ice: add check for null-pointer dereference Message-ID: References: <20241114113511.3729267-1-bruce.richardson@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DU2PR04CA0224.eurprd04.prod.outlook.com (2603:10a6:10:2b1::19) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SA3PR11MB7485:EE_ X-MS-Office365-Filtering-Correlation-Id: fc2911c3-a76a-45e6-e5e8-08dd08928128 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?xsC5RSv+1Tklsm+AUNASyiPFi7YaUCUGKw5jHlov4Ess1yVxKA20D7VigV+q?= =?us-ascii?Q?uQwJQSYAMkfEC3lbOW6jcevFatwAHOUjuRla/yhZm9XRySYih7e4qqfe5+hh?= =?us-ascii?Q?gvdH9HwhtAmW9J7CUeObpMJv4H7gy8l5dzk+cO3rGtYcvA+LuTs0xe3woaPR?= =?us-ascii?Q?z7PN/mma8WVKHXMnMF+unqOZPVSAvQBvqSkhIOFVpgvEJIvNmHgb6kdx0Ye1?= =?us-ascii?Q?Sk4Wef8qWDFtxWn6GESi2/A5Mvj99msNZGNVJwlzEOuaTpow84l53IyjbEUn?= =?us-ascii?Q?aEPWKQC3mb3nI4/RRULHjdh6QG3DsksxFIBmQK8iW72VuCdPNh8Fk5qYRT/I?= =?us-ascii?Q?F7kYpWlOV9wbTFAlTb0TZNxLnweOTaiTqq4tF5FWca1c+AqyWndTYVWiE7oB?= =?us-ascii?Q?nekZy/OQwQbt8ldym8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?Qlc3LfTbT4QYrQ+GQZElATEJ?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?toKhzVzM17xa2/kUqpk6yc60cifMVOuThcDNsAcO+5eGWZSO3WFOgElWG9es?= =?us-ascii?Q?A+0rI7Pk+NDl44LYGoNlxCnsj23qI1lLBLpDFX9ojUFGQbRjfZhP0QRScgJ6?= =?us-ascii?Q?7P2BHGR987OPZYxvWqEjpABQ04oEWisnedNl1pXTUeZ3h3nMbYZ6zacT3paH?= =?us-ascii?Q?aikrqPDtd3ZDDFOsTQH7HxERrbn6WU2+0lR7ba5u1ys/qc2fb66T6bBWocqa?= =?us-ascii?Q?F/BBtwct+Ss+uyOkm9+OWO/ypGzh8Ma38Shb+t1t9/yZUCnSRqg0FaDWVgX0?= =?us-ascii?Q?lTRQijiq479X6FKARrX3Q81bo6zbUHMDv6q88MSKuzrFyRH8fuX5D5qxwHjt?= =?us-ascii?Q?hGXQtLCIz1/qKVIwHt6/YgyxaDhYCDQRXqCJhSGuUuHcBkCH0kNyk8IhtOsE?= =?us-ascii?Q?yh3BAWBGCSQ25od496TgRzHp8Rp31HBwrUvGYDDX2sREX5/YbF+OeZF99xvi?= =?us-ascii?Q?kjNSeEfg47PqpyV61DmIQCsLLkf59CoF3/hZZHad+XDMrfVJHnKuqioh3SHt?= =?us-ascii?Q?sOLpd3TwdVQeWVr/UMJ0segFi7DLbJiGUzI1tvDHRCJ8iBIjGeTiCafRz50X?= =?us-ascii?Q?UVMxkCDCXDqUL/d4bGxS4q3EaIH4RzklHPUcgk5ce11Z/cEJMNy2GAI4JE4N?= =?us-ascii?Q?TltHCrRtRMcAnCeH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q?/cKhjw/x5hEx69zjVry4NOv7WyMShf7/9shNtcTRCjCO29YOXiXmydyduTDZ?= =?us-ascii?Q?4Q=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: fc2911c3-a76a-45e6-e5e8-08dd08928128 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 12:05:48.2800 (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: ayr/UbK2yHam2xXOA2Ft6WOaJu6H0I4HAo0kYSnkkpLF30OJj7Dw8a1mhodwBvavbK2k+Msm+WJDvMtdLliirS5r4QkTmCLtZBtsK86tarc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR11MB7485 X-OriginatorOrg: intel.com 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 Tue, Nov 19, 2024 at 11:57:15AM +0000, Stokes, Ian wrote: > > Although it should never occur that the teid (scheduler node id) value > > for a txq is incorrect, put in a check for null following the scheduler > > node lookup in ice_tm_setup_txq_node. This provides some additional > > safety and should eliminate a coverity issue too. > > > > Coverity issue: 448957 > > Fixes: 715d449a965b ("net/ice: enhance Tx scheduler hierarchy support") > > > > Signed-off-by: Bruce Richardson > > --- > > drivers/net/ice/ice_tm.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c > > index 18ac324a61..ff3a6cd77f 100644 > > --- a/drivers/net/ice/ice_tm.c > > +++ b/drivers/net/ice/ice_tm.c > > @@ -679,6 +679,10 @@ ice_tm_setup_txq_node(struct ice_pf *pf, struct > > ice_hw *hw, uint16_t qid, uint32 > > struct ice_sched_node *hw_node = ice_sched_find_node_by_teid(hw- > > >port_info->root, teid); > > struct ice_tm_node *sw_node = find_node(pf->tm_conf.root, qid); > > > > + /* bad node teid passed */ > > + if (hw_node == NULL) > > + return -ENOENT; > > + > > /* not configured in hierarchy */ > > if (sw_node == NULL) > > return 0; > > LGTM. > > Acked-by: Ian Stokes > Applied to dpdk-next-net-intel. /Bruce