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 9588BA04B5; Wed, 4 Dec 2019 09:34:56 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6EE5A1BF6E; Wed, 4 Dec 2019 09:34:56 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id E48921BE83 for ; Wed, 4 Dec 2019 09:34:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575448494; 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=NpI1zB82b2EOtLRrWJbDpnNYARbK7WEoT/VdHLZwKE4=; b=bxPKOBpH9uu1hjgj2IPUIDNZ0ibWhSdNpuTsRS1uOBLCczxyFty/Hq3FbWwMn8IntXwDi0 sM0VoA9fvmAmgjZaM3tgWMS13X0YiOg7Nyn5N/mW3/fuz6enczuAFc/U0denied4HKRl/d MZYonyUxz0d4wcXmCnD1HxO2n3dVNkA= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-305-mbeGl-1kPH2OSUggaiIGNw-1; Wed, 04 Dec 2019 03:34:50 -0500 Received: by mail-vk1-f197.google.com with SMTP id m25so2636300vko.19 for ; Wed, 04 Dec 2019 00:34:50 -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=Ct2JQqjN0jAPkp7VMSaR75EpdjxuJfXsyHQ3jkVhy0E=; b=AOuhUvMJdvnI6Q82xpfjUDSocNUhSG4FPiYKuQNvz1akYXnzaol7PMgnhO11XKmDC6 sIvQZ4ZDHOeAQWmm0TN/kuPwhQRMvlSDGqojUhcUKpoCXoOnsI+0aygF2e2feWos+fvX MhtcXh9TgAVSqNZOyRA4X3VJjLi9X+zBPM0B91mi2dPv4bEkCKUHQKbGa44wU64edze/ 3DQoWYxscUr5UrOMaxTlzBI9EZVSuhTIxaGq6OVlCRbm8olSXJokvyFdpUCfI2jpmuQc BjpFH93+LxaC9/n4VHFFhMhVHnlMOmHu99F/HoMUX3er8YDdXgGLudvc62tQMvr0lcPx Riqw== X-Gm-Message-State: APjAAAWUjFbO8bJJiWDB3349qNDnneZry2Z3G0yklSbF1/rXPhoHvkeJ XOzewJCBfcfUDuToi0Olc3Z5BKgezxb99UcD9FhM1ggaeqMNetH1c9ACxR1277lOpiDRCOSCucK qhTH3p0iisU1QCUex1S8= X-Received: by 2002:a67:b303:: with SMTP id a3mr863832vsm.141.1575448490037; Wed, 04 Dec 2019 00:34:50 -0800 (PST) X-Google-Smtp-Source: APXvYqx6hRJSzNAP55zIlHsKezXTi6yhn21hT1orAcdihsZ8qDIrWFIvr/XXaeu5C6gsesSZopXhrQaOxJCH5RUZjnM= X-Received: by 2002:a67:b303:: with SMTP id a3mr863817vsm.141.1575448489698; Wed, 04 Dec 2019 00:34:49 -0800 (PST) MIME-Version: 1.0 References: <20191126145606.13626-1-aconole@redhat.com> <20191203211544.20285-1-aconole@redhat.com> In-Reply-To: From: David Marchand Date: Wed, 4 Dec 2019 09:34:36 +0100 Message-ID: To: Aaron Conole Cc: dev , Harry van Haaren , Bruce Richardson , Pavan Nikhilesh , Gage Eads , Thomas Monjalon , dpdk stable X-MC-Unique: mbeGl-1kPH2OSUggaiIGNw-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 Wed, Dec 4, 2019 at 9:33 AM David Marchand w= rote: > > 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 functio= n") > > Fixes: e9139a32f6e8 ("service: add function to run on app lcore") > > Fixes: e30dd31847d2 ("service: add mechanism for quiescing") Cc: stable@dpdk.org > > Signed-off-by: Aaron Conole > > Reviewed-by: David Marchand --=20 David Marchand