From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 6DA784D3A for ; Thu, 1 Feb 2018 10:49:40 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 26F6B208B8; Thu, 1 Feb 2018 04:49:40 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 01 Feb 2018 04:49:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=pSaOLJ0ZLVFQ3oI2m 4AGxFVk8cM8UDQiZXL91YT7olM=; b=CAsLF5+9CHUJH0yZcy20TeNVDgMD9kMpo S8j65KaBonlgOvLuQd72x8vePERiyf6krc8hh82W7xrZ8A/TSAQj0Ewb0NTGK0Fm /Phcat90zlqXutjHKTsmJw8VJWHQUMj8X8Z2jz776KaBnrrK+xsBwHcOuy1j5UW1 3kYlBNojpYDK+Xq/oX23v6zBqgJwiqcCm00eU8LT2iSDyZQFSbp8isbG5qX4JBOJ 6iI0msq2qYbDh4qGaTJLpEywoEBl/8fAT7U3NbguIVXpdhaelBENqALQVgdpgj9n Uc2p5QO3XD1o3h0sb/cqch5xJn9CzOQyIpwVkTBflSNU6K3gKEx2w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=pSaOLJ0ZLVFQ3oI2m4AGxFVk8cM8UDQiZXL91YT7olM=; b=rutrIvjw wy11BKA+wuD6U1nEtgXnCZLJNLah+pYs5AYWRA+T2JJo9ZrksO6YU11CpB8Wl0o8 JU/JXMapYltowPiXIQTENbHSbGJCfEGdpPFPaFa31rGt5nlszhSOddsrjkKRepPl WVDvfYGXY6DrQDgD2o1kK5XF4Elkpp5XO8n30cGUQwmPg1HpqpKJvOtphV/V3BTF FBVL+tx2ekJPRR+D/SFaKhrWYBzOuX35IOxEHG/4oyVb05D/QUhL35lsy7KiYMtD 0swymHmLVsi8GSaKheYQtrCZJayL4CDR3Ng1yiIoxCTxjVKE/w3UDsjZbnQLy4kI v41fu4a1HO63Rg== X-ME-Sender: Received: from yliu-mob.mtl.com (unknown [115.150.27.200]) by mail.messagingengine.com (Postfix) with ESMTPA id 8CA4824610; Thu, 1 Feb 2018 04:49:38 -0500 (EST) From: Yuanhan Liu To: Pablo de Lara Cc: Fan Zhang , dpdk stable Date: Thu, 1 Feb 2018 17:47:52 +0800 Message-Id: <1517478479-12417-38-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> References: <1517478479-12417-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'crypto/scheduler: fix strncpy' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 09:49:40 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/03/18. So please shout if anyone has objections. Thanks. --yliu --- >>From a8eae224c746b0fbb8d25cca5aafc6dc69842f1e Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 29 Jan 2018 09:22:02 +0000 Subject: [PATCH] crypto/scheduler: fix strncpy [ upstream commit 6af3b03547d7499e8875f7e32effba172140bbfe ] The coverity issue was not completely fixed, since strncpy should not be called with max length. Instead, snprintf is used as a safer option. Coverity issue: 143431 Fixes: d040aca67170 ("crypto/scheduler: fix strings not null terminated") Signed-off-by: Pablo de Lara Acked-by: Fan Zhang --- drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c index df8634a..822ce27 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c @@ -467,8 +467,8 @@ rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id, RTE_CRYPTODEV_NAME_MAX_LEN); return -EINVAL; } - strncpy(sched_ctx->name, scheduler->name, - RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN); + snprintf(sched_ctx->name, sizeof(sched_ctx->name), "%s", + scheduler->name); if (strlen(scheduler->description) > RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN - 1) { @@ -477,8 +477,8 @@ rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id, RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN - 1); return -EINVAL; } - strncpy(sched_ctx->description, scheduler->description, - RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN); + snprintf(sched_ctx->description, sizeof(sched_ctx->description), "%s", + scheduler->description); /* load scheduler instance operations functions */ sched_ctx->ops.config_queue_pair = scheduler->ops->config_queue_pair; -- 2.7.4