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 C0F2045D42; Tue, 19 Nov 2024 12:57:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5467740268; Tue, 19 Nov 2024 12:57:21 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 4C7E440041 for ; Tue, 19 Nov 2024 12:57:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732017439; x=1763553439; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=2OC35G5rPGB3NHu3Ue0yG/nkPWHdJTL1CcYZr33kMfs=; b=kpBIKOC2h+fm5YPrRzuWud6Qk19XFbOFgIxUlzfZACcdgBnCQliRNtyH 4NDDvz4W4YtMaLsMLlxEhabVyYMgGdhnZzf2wI6+WNWje+v5TX7+HZQlC z08bZUgniC5GXt4FkYmCmwFtDnknm0iAXjPutgqSxXPGqnwQ7oLQsSVpK aNnShMbgM0Ar1fulRxB7FB/p26eo3hlM8hIiBLKPjijnUNxPATTiZ/9gJ 4gA/onVoYXKbFD62hPWSl1wMIgNfthjxA6U0Dn1mGYVZPHo3fLM3oJph6 xisYVgBDhy+vf7fsnhZ17aw/SJF8AHIBL/OAmjMb80yhA0t+QkUQazfkA g==; X-CSE-ConnectionGUID: 26s44LP0TOSJbZos9EqgGQ== X-CSE-MsgGUID: z1Q59MwgSVaayRbNv5NaWA== X-IronPort-AV: E=McAfee;i="6700,10204,11260"; a="31419811" X-IronPort-AV: E=Sophos;i="6.12,165,1728975600"; d="scan'208";a="31419811" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2024 03:57:18 -0800 X-CSE-ConnectionGUID: Lvb2zcyGRmOGYHRnXv9GXQ== X-CSE-MsgGUID: Gher3JhHQTy6bD6RWxD0wA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,166,1728975600"; d="scan'208";a="89665909" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Nov 2024 03:57:18 -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 03:57:17 -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 03:57:17 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.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 03:57:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OsuCtSso8jqWy2aj6PBk0Fsr423ZE8GwOr6jXtZVBOcYJpjikL65bNYRtSiSniG6ll2hg5vdAAq+aLYAdlySj2VMtLnG1UEEl/UR/z7Lp8e5MJcJPyd9O15iRSd5l0a96zx5hUxcq5Oa7K8Uj+46p9mLaeAvkwIq7FzK0NnznBmecnss8FWbUyEF2pTQZJO2PdLK4Pfvh6t28+Frp1BQXoGqZyN/bO3YW2BckphRLBC0lflv31ZJd/zwrJLMH8YziupiTuMydS0UacAjcHxi3BzXK8kXuGiIBK8wECx8snehJbVmSWPXYUZlr51II7VekLDMyMevDpKfum5yvM/0RQ== 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=DR6o5nnElGX2mnhZGpQApm1YZPo0iBWcEsdEU5CBqjQ=; b=ireJmkOYrSehkv6YPU6c2Fh48byfSDqs/Q41Ulp6XIQVac1o4qj5qBjpqmMfXlbLPVAKcuVzE0cyaIgtR2PYpp6R48go89nhS9W36gtR+GyZpq624SKs+JncDDXsFeBu/i2/jU5HQM6Ks+5IG4qDG4OA+Ld5hC6Zf+0d25NlIL8TD7FkZjvFvKI4tHauccxLr3fjLaurLk6GdfPskZoxMBC96JKMyn/Y0Rrm6Z2XyueQFqczR9iGk+tOsEin0Y/ewGz0Zj+682tGiB7BGWrft9Zj2RjUR3iT6yh0kZMysfm2AjtDnCNT5aEYZxlpVju7yII5VHjozS7J8lS6bg6FrA== 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 Received: from MW6PR11MB8309.namprd11.prod.outlook.com (2603:10b6:303:24c::19) by SA0PR11MB4559.namprd11.prod.outlook.com (2603:10b6:806:9a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 11:57:15 +0000 Received: from MW6PR11MB8309.namprd11.prod.outlook.com ([fe80::ba43:b01f:aee0:10a8]) by MW6PR11MB8309.namprd11.prod.outlook.com ([fe80::ba43:b01f:aee0:10a8%3]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 11:57:15 +0000 From: "Stokes, Ian" To: "Richardson, Bruce" , "dev@dpdk.org" CC: "Richardson, Bruce" Subject: RE: [PATCH] net/ice: add check for null-pointer dereference Thread-Topic: [PATCH] net/ice: add check for null-pointer dereference Thread-Index: AQHbNolh9nzVxu483U+5xrc9JGMNpLK+huvg Date: Tue, 19 Nov 2024 11:57:15 +0000 Message-ID: References: <20241114113511.3729267-1-bruce.richardson@intel.com> In-Reply-To: <20241114113511.3729267-1-bruce.richardson@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW6PR11MB8309:EE_|SA0PR11MB4559:EE_ x-ms-office365-filtering-correlation-id: 94aa16cb-124a-4d04-f614-08dd08914f8d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?tfxqpwmFb7sgjNGe19zIpFcPcfmxIkFA4QfP64pHYhDleJfX9488WzE78090?= =?us-ascii?Q?VX2XaBEXgXXjMFLDtQME6s8LDngr3ZLW+SiEB7VajadPPQz9Pqz1bvPvKuEL?= =?us-ascii?Q?ZuWWtgdlX/M9zSEEOM7YJU+WyZRZXxvGyAk+PMZpiXQYcqb3fzFawEEIR+S/?= =?us-ascii?Q?5Sgok6PXR1dMDXkFIRIuhdqN8ZZEwWiS6JvpX3Ej0GJsohN+vhf7s1rMrSrM?= =?us-ascii?Q?GIQTCvOTxQFz6OIxiy0qN6+AgiM2TUof8K4rlNRBXNAEAny2kp+6j17D27GI?= =?us-ascii?Q?sfGQWET/cvWmpyK+AlmHJRyON762WvASL8dULy04twSAid1R+bwq2LJeNLw7?= =?us-ascii?Q?gbIm5gnLdf5ng9W2ivZkjnGIvgywqA1oQl+woqE81nN4REAY1qZDJOE4Zgbu?= =?us-ascii?Q?McFYoue3lO2b13okP9aCcgzex+sf7aGnAntX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ZP2vPv54zcmu0wsK0fLNwtTHGVvB6FuFefZc/4zeuuev?= =?us-ascii?Q?I/3soWU=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW6PR11MB8309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ORzmno0Ski+kUp2GRbgKpPsbYrkxSvNBloKhDB/ISIxE1lj6YxwxzkAG5PKb?= =?us-ascii?Q?rvwHpF11RaRssfqfU5hEMa3wTsuGxL3S9O7Rn8bTk4niRL2DPNV8O4RdACTw?= =?us-ascii?Q?bSOQKPyRyZjQRJhXwpkJYQTa9Lo0AcsOgmYrRvhs/SFmWksGvn3jXLArADGk?= =?us-ascii?Q?n0RVRlg/3Cv1KdKNxbGmNvvel9RwIdkCd4EPujCuRgrmMyCDv3L9dozh5glI?= =?us-ascii?Q?uyeELuIwqNEZrb3Zc32MSG+gbzfT3YA0W9riQamszUDJZJLqaRZkuZHr85bM?= =?us-ascii?Q?k86SetKtH1orO8bTk/5Z93P0F7bIF2oZxKh/dnGlw7WCUAAV8e4BecElv9ph?= =?us-ascii?Q?XHyozNF03J5FBfwrjaZ3HvatdN10ZbMwb97Mwq8Dp9xMQ9FK7j3GwP84twfg?= =?us-ascii?Q?EdmdlWOXaHbOtfMp2SyLMaIRX8Pe+cdkrv8m9xxCsQr9W30M3z6fqy4hgOIw?= =?us-ascii?Q?uwIVFCmdxhxwqVbbD9fUA093RJG9hJE0hMou9B547mN3u0sJHzy/WS1uEbhc?= =?us-ascii?Q?xiHl5j3Zg5D2u6z4a8myyuLMexdhGpqLZ3d2VhLBRmx6LS6oI74E3/c2uA2+?= =?us-ascii?Q?kmjXEP/72VNcMWh4uIiAfTDALszJAH6hpw+3OFgRnMX97vHxx4/E2C2trXFF?= =?us-ascii?Q?2tE0+fyCdxoZx0sGWWwSwI9jxOwKdDjNmS6C95vCO44blHP3E/2VqozFXLPm?= =?us-ascii?Q?GIgMhE03C//59DT5WBFWEiAWxrRQmWDk5rumFpve+TSOL/o7lTDWdHKH/5Y3?= =?us-ascii?Q?Q5eBDk70TI6fQDlv7xli2316hIWsqS34YeECyE17jP+u7SeKloXdIrm+O12m?= =?us-ascii?Q?SkqfSADp130DbsDtVcDHjNa1xJK1Tn+8dt/uOnbGqmqy+idj7zrvhGzAjsuK?= =?us-ascii?Q?OpYE2f9tMDLU25VngVMee8jj+WoKalBiWVAzMKKpj5KhD5eHakHjEYewV6Eb?= =?us-ascii?Q?Q+7MIi8W8MWdCf0UUCew4UnYu3Gz1qY+NgdIcPtjY235kPxDaWqZ3ThGrl0a?= =?us-ascii?Q?fYUMmpqPWY3TTFJXC3WxHQp+4CELMOVLz/z50eF8atdyItriKOONLTwfbDdZ?= =?us-ascii?Q?QbouuBBxGBY8yBfPDMUO5ukNjkTATLNHsoPy0yk9reIhO2B5CQAsp4iMYEbv?= =?us-ascii?Q?XrpzDJooZ77OOJmr4mROY5vgakj40lmRGbemVH5BE/s4nuHI3QjW4P1S+3Pg?= =?us-ascii?Q?qTz1SQex88n4zDgSBpa/U2LDlaTwAcoUb5gZiHT7RSszsQD/8uH/8e1GJPR+?= =?us-ascii?Q?596chyTXClswJ6boHSRRinQ9MPemGDhdCGfEti1P2FnMscS0Kud253AJV7ht?= =?us-ascii?Q?s2NFo3Gm6/dzDxIbWWWN1F3AXdSFSkEIGVdC3Y6Cgz7JTwET4YpBlG1dkIXI?= =?us-ascii?Q?iwT7yHu4KrycXetV6DwMJjE/2/41vu0KHe7p39dP8czsHvej0lc9rmb3g8Ah?= =?us-ascii?Q?87COq+IXBoKWVphmv93Zck/nWnP0AmUqP68jKd469U8PUFE8s2SczoqEbJA0?= =?us-ascii?Q?6D/2H4bAR56rZCPXrftm79T1Q7+Uf6nQsnAesZQScJm7cFxxrULnITKqjFNY?= =?us-ascii?Q?pTLffTLmFjzk/Mh8cq0=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW6PR11MB8309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94aa16cb-124a-4d04-f614-08dd08914f8d X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2024 11:57:15.4366 (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: Y7yHz+PTbyE1D9aCV4qbHtST7uw14Mx5SPXsoeZ4fI5aTM1QrFPKL4p4krJsCoEoe9u3Zaf7pC3/Ou3q+eiGPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4559 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 > 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. >=20 > Coverity issue: 448957 > Fixes: 715d449a965b ("net/ice: enhance Tx scheduler hierarchy support") >=20 > Signed-off-by: Bruce Richardson > --- > drivers/net/ice/ice_tm.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > 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 =3D ice_sched_find_node_by_teid(hw- > >port_info->root, teid); > struct ice_tm_node *sw_node =3D find_node(pf->tm_conf.root, qid); >=20 > + /* bad node teid passed */ > + if (hw_node =3D=3D NULL) > + return -ENOENT; > + > /* not configured in hierarchy */ > if (sw_node =3D=3D NULL) > return 0; LGTM. Acked-by: Ian Stokes > -- > 2.43.0