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 45679A034F; Wed, 6 May 2020 15:22:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CA39E1D9C3; Wed, 6 May 2020 15:22:55 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 516761D9AF for ; Wed, 6 May 2020 15:22:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588771373; 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=3R18gd4hbiV9Lavj+6LS5rZPVe4qSbzGXDNGrjRyfEg=; b=VRkI8dkTyJzvHXh/mTyBbx1xXnyTY+bdFGZQepxndieXqH11YeO2OVbdJsvDEeBk9fTlX1 oCjNiM4oftDZJg3UNSw+yG3unL4VNf/MPMwww2xmgoHG/bYQL/AtzERMHHnIyHJr2IepO7 uF/Ce3ToThJ77EF3iAhJsNZKMjyiOFE= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-wix8zkwAOlaM2C5llijQhA-1; Wed, 06 May 2020 09:22:52 -0400 X-MC-Unique: wix8zkwAOlaM2C5llijQhA-1 Received: by mail-ua1-f72.google.com with SMTP id w12so681567uan.9 for ; Wed, 06 May 2020 06:22:52 -0700 (PDT) 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=Arn78UDwzfWibc+BLKPvGFN7OvQtc3WR5vWM4skh2oY=; b=cv66YqPDbMQznCsD9AvoUvs0hC2P9nIZICBgeOnuwz2XHLiQOjGUFgwIErkwQNq1w7 NHPCwsf7WXFJkCVNI7yTH/v6K3zfFAWE/6nrkZtlxMzRzYC3MpFbwmLxBs/yv8KtAxsq C3l10yOK31wED3bM2hvu/IKWknml5esSubXMhmsHnekMFsTGFfPxgAtJ7+wxL5EviPzw 9yKsrSfEfruFkh8/mvuUJP+FBKFiMOpI68zvvfMRmjcgfVB3UckFWesdQ0ldXBpPnmId Arm0Rcf8M+SeTcJ6zoZXRA+yO16I5/HBJr1HTEugh3jmYQBSVYdbqgHfO8IEa/ziLvaa uENw== X-Gm-Message-State: AGi0PuYC2rsX+B1y4adhbEY6g2vOG/dsf64RlttvZ71BmNUwPweMVgIB LxDXdJu7ZStVYef6YMXoQAdPUbWsZQcMsbQvZ6BaCU4AXmdHQ07pxW+mn1q5NavSV6/X2N/ei4W cpQG1m2pNXAXkjslyrKM= X-Received: by 2002:a67:ff95:: with SMTP id v21mr7452863vsq.105.1588771371921; Wed, 06 May 2020 06:22:51 -0700 (PDT) X-Google-Smtp-Source: APiQypIitbq9JtGJH0+fxu4Lvj0LlSCEvfLeC9pcHSdnH1pEpXDf/i6tVHi8drxxWRIMEdiqJ3lPLGIepYyIx4/DbiY= X-Received: by 2002:a67:ff95:: with SMTP id v21mr7452829vsq.105.1588771371622; Wed, 06 May 2020 06:22:51 -0700 (PDT) MIME-Version: 1.0 References: <20200429131700.25294-1-olivier.matz@6wind.com> In-Reply-To: <20200429131700.25294-1-olivier.matz@6wind.com> From: David Marchand Date: Wed, 6 May 2020 15:22:40 +0200 Message-ID: To: Olivier Matz Cc: dev , dpdk stable X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] kvargs: fix crash when parsing an invalid token on FreeBSD 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, Apr 29, 2020 at 3:17 PM Olivier Matz wrote= : > > The behavior of strtok_r() is not the same between GNU libc and FreeBSD > libc: in the first case, the context is set to "" when the last token is > returned, while in the second case it is set to NULL. > > On FreeBSD, the current code crashes because we are dereferencing a NULL > pointer (ctx1). Fix it by first checking if it is NULL. This works with > both GNU and FreeBSD libc. > > Fixes: ffcf831454a9 ("kvargs: fix buffer overflow when parsing list") > Cc: stable@dpdk.org > > Signed-off-by: Olivier Matz Tested-by: Zhimin Huang Applied, thanks. --=20 David Marchand