From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F25FEA04B5; Mon, 2 Dec 2019 17:17:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F1911BE82; Mon, 2 Dec 2019 17:17:58 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 7C6001BE80 for ; Mon, 2 Dec 2019 17:17:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Dec 2019 08:16:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,268,1571727600"; d="scan'208";a="411827945" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 02 Dec 2019 08:16:49 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 2 Dec 2019 08:16:37 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.57) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 2 Dec 2019 08:16:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mqagaVdSCBt4W047tNsctstzPdvK7LNRa8+06ARU7MWAiwQslCPjUpQCysSpTaZKLnul5F/2utFh892r5IyPDUYN5HiE6KlVxlqjMLk6Ml+lb/9Y+USkTrZZzmSpK0c+ujsChvRtORpdurZ9DRe37X0byRHXcH0MsnF3B8d6rDbTOd1CsJc4h3f84H9cWH5nJqHubYJn5N4AaPoRL8mB87t3R2eaxGjvoM8omkngadGiax4qUrcBxCYgJVd0/LWDhWuF16pUl3xmHqW1vV/ZfmJdkYcUiRNAXSrgh849sUxnf+GQtsoaJa+nJsT6595VfnN3I68x/4ZZy/CCXiiYCw== 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-SenderADCheck; bh=zweKFUuCV+rOwa3Ygof/6U8I4+B87vILEDEnEW0XyTg=; b=Pr1ql/MvJyr1qhGMDOdBzY5xXOTEvMugLJtOPvJDrED03rRsb20YiT34siogvgaR4jj17/5H1GKOKRyqGAMEP0qFNqef0bHiLTFVZe2k5s+S51xjk6KFD610n0oIYK7PURCIuToH7hS5R5iKf/FCcTP/Yj5AwvD8vbFIHFuAR1qPVQ0sBGV4jzgVG9Y4rOqdjirLYhxYhfToQXxoooBM/eFolABDT7wvw8E0ySgoIxQ7FK5PaILVeD/O9mI7AsZHcB/iP9hldOs2TqpDihtUxW/eOCJdzgkj4QxBxvYhKppbnPoe6RtJ0PyaZ5pdx/6Xk9xQVwkByVw28wtAGtw0Ng== 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=zweKFUuCV+rOwa3Ygof/6U8I4+B87vILEDEnEW0XyTg=; b=DbUfU+GvpIi+9FnGdJE89rOHUtZYiIqnkYoIP4H+vg6tVVSQ2WZXQcO+4fkDBn1SU/N6/GPVWMFeIOYhsnrD572gRMvsnwyF7h/g582QS3eg8UEw6smljAqnQEUyrjL2+4wJkxHTnJ9dRUIHfLEKiaOIEXeMb8Zq+Rup2IWhZU8= Received: from DM5PR11MB1756.namprd11.prod.outlook.com (10.175.92.17) by DM5PR11MB0060.namprd11.prod.outlook.com (10.164.253.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.18; Mon, 2 Dec 2019 16:16:34 +0000 Received: from DM5PR11MB1756.namprd11.prod.outlook.com ([fe80::880d:e35e:13ed:1ca8]) by DM5PR11MB1756.namprd11.prod.outlook.com ([fe80::880d:e35e:13ed:1ca8%5]) with mapi id 15.20.2495.014; Mon, 2 Dec 2019 16:16:34 +0000 From: "Eads, Gage" To: Aaron Conole , "dev@dpdk.org" CC: "Van Haaren, Harry" , "Richardson, Bruce" , Pavan Nikhilesh , Thomas Monjalon , David Marchand Thread-Topic: [PATCH] service: don't walk out of bounds when checking services Thread-Index: AQHVpGnJXKJ6vxYCLEuuMyrVNTRqZqenDoVQ Date: Mon, 2 Dec 2019 16:16:34 +0000 Message-ID: References: <20191126145606.13626-1-aconole@redhat.com> In-Reply-To: <20191126145606.13626-1-aconole@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDdkMWNmMDgtMGZiNy00MWUyLWE3MTMtOTdmM2I5MDMzMDZiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZ2RqbElKVVlPR1pObGZzUWZIa1NvQnEzVlBtUUhBcXM0RUFPWW11cFdBT0ZRNUs3ZzlZeXFTMXROUHpRemhvYSJ9 dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action authentication-results: spf=none (sender IP is ) smtp.mailfrom=gage.eads@intel.com; x-originating-ip: [134.191.221.96] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f3fc85fc-ebd0-4a78-bc7b-08d777430034 x-ms-traffictypediagnostic: DM5PR11MB0060: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2089; x-forefront-prvs: 0239D46DB6 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(376002)(346002)(366004)(39860400002)(396003)(13464003)(189003)(199004)(53546011)(66556008)(186003)(229853002)(256004)(66476007)(76116006)(86362001)(64756008)(66446008)(55016002)(66946007)(4744005)(110136005)(54906003)(6246003)(6436002)(316002)(4326008)(25786009)(478600001)(102836004)(11346002)(33656002)(71200400001)(71190400001)(5660300002)(446003)(26005)(6116002)(3846002)(2906002)(8936002)(9686003)(66066001)(81166006)(52536014)(74316002)(81156014)(6506007)(7736002)(99286004)(305945005)(7696005)(14454004)(2501003)(8676002)(76176011); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR11MB0060; H:DM5PR11MB1756.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Xy1UNf4s0+QSzd6ZaXiimUkDIC/dV3/9Unhw9cKK7LnqBEhN2ABZcwcJPKtNCuIGz9QaOYniuoEIFK8zHTkrUziy/IKfyOSUqdX85HMs0MxQLt40L9ARujJqADk7Fyoegf6F8Fic1qQ2SOyS/HbmHRarJ43ZQJdrEKeNLw6inktpMVe5UW1ly0c6a3hnZLwusplf+gAM5F0bdvfqHzmBXgQdcA0+2k2oGEAiIaXcliqbYYv5LpGuo0YgOaimcCS3Jw9thqxSdv/Hrz22vQAKoVaiu12axuP2bKZc9bFnLGcmH7n5zZjqT6Pq0S2sMf1FgS67frvPrcKAzKqSQicHfTyPffPRZGtJk44zA6lrYfDEXwYvPaSoxkGZ3UZ0GFm79kJfsHDSykLNAEkfFVy2LxXCZ582HBSnLqKam9MAgT9fGlh4qmV8x8S8piVwH/dg Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f3fc85fc-ebd0-4a78-bc7b-08d777430034 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2019 16:16:34.4515 (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: 2eG1aEBg9auA0zEcpFL2TdXNEJK/aN6QWZqMJs0dny+5f3yba+I+hd5EBmNTo+9oF4y1/CDkF5RXy4MdIsGxVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB0060 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] service: don't walk out of bounds when checking services X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" > -----Original Message----- > From: Aaron Conole > Sent: Tuesday, November 26, 2019 8:56 AM > To: dev@dpdk.org > Cc: Van Haaren, Harry ; Richardson, Bruce > ; Pavan Nikhilesh > ; Eads, Gage ; Thomas > Monjalon ; David Marchand > > Subject: [PATCH] service: don't walk out of bounds when checking services >=20 > The service_valid call is used without properly bounds checking the input > parameter. Almost all instances of the service_valid call are inside a f= or() > loop that prevents excessive walks, but some of the public APIs don't bou= nds > check and will pass invalid arguments. >=20 > Prevent this by using SERVICE_GET_OR_ERR_RET where it makes sense, and > adding a bounds check to one service_valid() use. >=20 > Fixes: 8d39d3e237c2 ("service: fix race in service on app lcore function"= ) > Fixes: e9139a32f6e8 ("service: add function to run on app lcore") > Fixes: e30dd31847d2 ("service: add mechanism for quiescing") > Signed-off-by: Aaron Conole Acked-by: Gage Eads Thanks, Gage