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 6D0D9A04B5; Wed, 4 Dec 2019 09:33:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8FC451BE84; Wed, 4 Dec 2019 09:33:28 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 17ACA1BE83 for ; Wed, 4 Dec 2019 09:33:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575448406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=id/TA/5oXfw+GDqgblrQZzKhr5UkRA080SuEm+e+Crs=; b=YDxxt82b4hGv+UCwtb5oLpCrTCe+pzI0V6m/woc0Y1BT4tv4Ot84j/VxNwELu5nOh1eyzf Tv8ce5Y5kkIodXtE/hjM/k1SRqba3+moY+OoB1716Sq4/OfGYtTqo0oJX/tC+XU+2cJxID GI4IbJB1i75KnM8WkrK5LwYX4rUzqyY= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-43-ZGiUBm6dNeyqq1Au0Hnpuw-1; Wed, 04 Dec 2019 03:33:24 -0500 Received: by mail-vs1-f72.google.com with SMTP id b5so598070vsa.6 for ; Wed, 04 Dec 2019 00:33:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6qQo4gHYLhfOM0PDIdab7LULNiQiTUFdkDsNSa6+URM=; b=N5PWFkXpkId3RCfTxR11s/tysf72GEWLPPWTaqmmJFJtgoGCsXgiyaopIXnoYssXzP 1u0aJGybMWCKE7QMpVofVbegcWE3bggJ9JusT1gMVWFcjBDDyyDr3WcAZViPyIPqz+KQ xo4V5atV5gj5mKno5PJU5KWMXaWfN7QeVqSjR6xsH1iEajaLQtg705xc6bTvaICPXcRf 5tdc4pDlD+EvjdtayFxqZjWhoKNhoCQt/fWnatdOtRYAgqHcFXET1MFzFnf++NJ+dRW5 hP74RIRXzsxdcGLgDfYR3LUOdmwsUA6SKNne0OYbiq8+a/jGQ+CBwpN0jbmU0mPFD2pA 8BQQ== X-Gm-Message-State: APjAAAWBoo7OKzAf2hzEMECCyvX1gaDzc2WxY2jaqrnmKcON1x2+4cbZ lHp7RHpn//Avls3whdzeSmU1XFhl+73dLEU8qmijv0y7ioDoEDdoDoR06QfgF/bzopQhjtGcQEG SKAVRPmSicTkCC+b0mCU= X-Received: by 2002:a1f:5e13:: with SMTP id s19mr1216421vkb.12.1575448404306; Wed, 04 Dec 2019 00:33:24 -0800 (PST) X-Google-Smtp-Source: APXvYqywr+gyckWUzM7e+2bCY1Ax/j8enSDD9XGVOH7Zc3hv4sQT+AGXivy/beXNhI0JxWYldAIjkb8echJSa/hr5mQ= X-Received: by 2002:a1f:5e13:: with SMTP id s19mr1216395vkb.12.1575448403974; Wed, 04 Dec 2019 00:33:23 -0800 (PST) MIME-Version: 1.0 References: <20191126145606.13626-1-aconole@redhat.com> <20191203211544.20285-1-aconole@redhat.com> In-Reply-To: <20191203211544.20285-1-aconole@redhat.com> From: David Marchand Date: Wed, 4 Dec 2019 09:33:13 +0100 Message-ID: To: Aaron Conole Cc: dev , Harry van Haaren , Bruce Richardson , Pavan Nikhilesh , Gage Eads , Thomas Monjalon X-MC-Unique: ZGiUBm6dNeyqq1Au0Hnpuw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v2] 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" On Tue, Dec 3, 2019 at 10:15 PM Aaron Conole wrote: > > The service_valid call is used without properly bounds checking the > input parameter. Almost all instances of the service_valid call are > inside a for() loop that prevents excessive walks, but some of the > public APIs don't bounds check and will pass invalid arguments. > > Prevent this by using SERVICE_GET_OR_ERR_RET where it makes sense, > and adding a bounds check to one service_valid() use. > > 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 Reviewed-by: David Marchand --=20 David Marchand