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 5478BA0C41 for ; Tue, 30 Nov 2021 17:41:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48C66410F7; Tue, 30 Nov 2021 17:41:42 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id DC37C410F7 for ; Tue, 30 Nov 2021 17:41:40 +0100 (CET) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A55DB3F044 for ; Tue, 30 Nov 2021 16:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290500; bh=Um0KrtnUxnyg8324Pa8nRfRuh1iE9/Dd5/02nhIiFPs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=faaVzLsfjpCmJ5yqPHEw9qfM5DfapL4QRqt2Gm/5E0V3bvk1WR+Eu/aVc72mEj/hc J+Ovb/7U750vpOnWf8tBUV4O2IHuAPxEBsYMdvbthklhR6ff9InlzWQPVtOHaMPal3 YG6Cf8wgCHI45ly/wYGV02ONQcxV7dKglucXHridPneoRgTAyobuq5CSrOOs2YLmr6 9q+iCs8EXLDdOZG+YJEo00ad9dnvooKGQf7MAg2ny/SbznvRK8uuX38TrDALv/qjtZ 92CKJfOdxr+Wg2PGOtLBks/pKPWpl6OJ2nQS45USCJfkg93W4clDUS/8u5X5DC9egk WtVDF5lMLSBoA== Received: by mail-ed1-f72.google.com with SMTP id c1-20020aa7c741000000b003e7bf1da4bcso17386635eds.21 for ; Tue, 30 Nov 2021 08:41:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Um0KrtnUxnyg8324Pa8nRfRuh1iE9/Dd5/02nhIiFPs=; b=vzSvLFcDAB8cA8sSC8BJIwmeGf8MM7BtkI/r4yQcK51hJOr0nqYmqC3VCXuRZ7Ik84 Ag63lgAPJDGTzYfojCnzLy0ImFwBOXhaTUDAOwRD544DUr6T3Y4xQdKoP6GFmuBU2O+d xcJIKPzmDToTNde+l5uY1q1SahUEfLVs4iS4LTP7YEcDVf5LIzehMXnynej4J0poArMC LGfIfMw5X/qt7bXU3tMTFf6rAWGv64ugFz7XY6b3Dx8/7N5adW+N1BW1N6YAWc8kOxo2 gJS1omArxbUysBrycR5KTLHlNcVd346BfaPrhHHyCjNcpIJGFJZ9ay4hXp+iSTKubuGj 4Spw== X-Gm-Message-State: AOAM533b7mVuluS9keKV5bvbCutwMnaEaru72eAxsmlORoz38DrceM4Y 7bh3BRY543lYJQuHzxhiXdHUwGlet4D8Fb3SePaF8nbOLHa61Xpv7vdXZzJ5oPQ43V2ARMEbHHb H6DTI7G2rdh7hun+1HrVpnuP3 X-Received: by 2002:a17:907:6ea1:: with SMTP id sh33mr281310ejc.150.1638290500365; Tue, 30 Nov 2021 08:41:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0sT4ey/GOB2eQBaefNKL/CpQljGe9/gxH11nS/DqfjRA+0w5ea/gd+CVS3Ll50QUgdRqsDw== X-Received: by 2002:a17:907:6ea1:: with SMTP id sh33mr281291ejc.150.1638290500138; Tue, 30 Nov 2021 08:41:40 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id mp9sm9690411ejc.106.2021.11.30.08.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:41:39 -0800 (PST) From: christian.ehrhardt@canonical.com To: Zhihong Peng Cc: Xueqin Lin , Bruce Richardson , dpdk stable Subject: patch 'examples/performance-thread: fix build with ASan' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:35:10 +0100 Message-Id: <20211130163605.2460997-106-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/478db9fdd0f6214bd02fce0dfe49723d82b68228 Thanks. Christian Ehrhardt --- >From 478db9fdd0f6214bd02fce0dfe49723d82b68228 Mon Sep 17 00:00:00 2001 From: Zhihong Peng Date: Wed, 20 Oct 2021 15:46:43 +0800 Subject: [PATCH] examples/performance-thread: fix build with ASan [ upstream commit 4d2d1258151657d69b0be5d118956b7e809f9d47 ] Code changes to avoid the following build error: "strncpy specified bound XX equals destination size". Signed-off-by: Xueqin Lin Signed-off-by: Zhihong Peng Acked-by: Bruce Richardson --- examples/performance-thread/common/lthread.c | 4 ++-- examples/performance-thread/common/lthread_cond.c | 6 +++--- examples/performance-thread/common/lthread_mutex.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/performance-thread/common/lthread.c b/examples/performance-thread/common/lthread.c index 3f1f48db43..190e5874b1 100644 --- a/examples/performance-thread/common/lthread.c +++ b/examples/performance-thread/common/lthread.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -463,6 +464,5 @@ void lthread_set_funcname(const char *f) { struct lthread *lt = THIS_LTHREAD; - strncpy(lt->funcname, f, sizeof(lt->funcname)); - lt->funcname[sizeof(lt->funcname)-1] = 0; + strlcpy(lt->funcname, f, sizeof(lt->funcname)); } diff --git a/examples/performance-thread/common/lthread_cond.c b/examples/performance-thread/common/lthread_cond.c index cdcc7a7b5a..e7be17089a 100644 --- a/examples/performance-thread/common/lthread_cond.c +++ b/examples/performance-thread/common/lthread_cond.c @@ -20,6 +20,7 @@ #include #include +#include #include "lthread_api.h" #include "lthread_diag_api.h" @@ -57,10 +58,9 @@ lthread_cond_init(char *name, struct lthread_cond **cond, } if (name == NULL) - strncpy(c->name, "no name", sizeof(c->name)); + strlcpy(c->name, "no name", sizeof(c->name)); else - strncpy(c->name, name, sizeof(c->name)); - c->name[sizeof(c->name)-1] = 0; + strlcpy(c->name, name, sizeof(c->name)); c->root_sched = THIS_SCHED; diff --git a/examples/performance-thread/common/lthread_mutex.c b/examples/performance-thread/common/lthread_mutex.c index 01da6cad4f..709ab9f553 100644 --- a/examples/performance-thread/common/lthread_mutex.c +++ b/examples/performance-thread/common/lthread_mutex.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "lthread_api.h" #include "lthread_int.h" @@ -52,10 +53,9 @@ lthread_mutex_init(char *name, struct lthread_mutex **mutex, } if (name == NULL) - strncpy(m->name, "no name", sizeof(m->name)); + strlcpy(m->name, "no name", sizeof(m->name)); else - strncpy(m->name, name, sizeof(m->name)); - m->name[sizeof(m->name)-1] = 0; + strlcpy(m->name, name, sizeof(m->name)); m->root_sched = THIS_SCHED; m->owner = NULL; -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:11.974298631 +0100 +++ 0106-examples-performance-thread-fix-build-with-ASan.patch 2021-11-30 16:50:05.910874410 +0100 @@ -1 +1 @@ -From 4d2d1258151657d69b0be5d118956b7e809f9d47 Mon Sep 17 00:00:00 2001 +From 478db9fdd0f6214bd02fce0dfe49723d82b68228 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4d2d1258151657d69b0be5d118956b7e809f9d47 ] + @@ -19 +21 @@ -index 98123f34f8..009374a8c3 100644 +index 3f1f48db43..190e5874b1 100644 @@ -30 +32 @@ -@@ -465,6 +466,5 @@ void lthread_set_funcname(const char *f) +@@ -463,6 +464,5 @@ void lthread_set_funcname(const char *f) @@ -64 +66 @@ -index 061fc5c19a..f3ec7c1c60 100644 +index 01da6cad4f..709ab9f553 100644