From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com [74.125.83.51]) by dpdk.org (Postfix) with ESMTP id 0E1FB7D53 for ; Mon, 21 Aug 2017 11:34:56 +0200 (CEST) Received: by mail-pg0-f51.google.com with SMTP id m133so14710559pga.5 for ; Mon, 21 Aug 2017 02:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dah6K5UYfmm6jHd8+qcS/oG8twwKR3bT7DHZTVh9YvA=; b=QtnAqbXXLGOVtu6qxIbhDgTViziFooAIvli7o++UqOIoapH/z+bwxG4zdOXuj7xFMD gDh6RFZgwwCmFR0r03jWI2KDBkswxiSopQlPDwZQvSh54vMB0FIp+XnbvsNok4poH7cA zqzxO1NE6wSGWtdwTt7OWSUVJG6+9Xrdb2JRtKS8gmJglmOZF5XMW22+5vkwXjCVGle9 N+kzzF/g9d0fTtxJ13ANKRjhs01ySshxmepRVO/7iC+MFD+t0ekX8PPY5Op9VGYYxpx7 fTXPofm/I+c0oh8/jxMj5CA1GUVdhdvLxusnEDqQxuuBMvWNM92bOs+tfxBbyc2omPwH zKOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dah6K5UYfmm6jHd8+qcS/oG8twwKR3bT7DHZTVh9YvA=; b=K8M8/T4d3L9VLzy/42hXfVCcNcBfPrW9lnpMjOgwxK9rCRYWAw29N6lOq6ThqPrykC OtEJQAnP9BizCkIJ2yKaGPchBmttiHsIXCLVA3JgKDJ5Vo5HJX/CwUKVzRizspVOj2wR W63MQ2LSTymv183uE3FHGe1e74fV9J2dPKQKnCXiBCQY/w/Zx6ZWYTkI4+z7Kr+E/Gjk e7kKuTeoamRr4IkdOhBFX622UOK6tgDYJ1X9ipF6BxO45QtXZOK71PXLkD5Ic9mTAqGQ rD+UEQj37dv7bnElXmJdHWA/0XvX5YY5KhOfvooOdHyUjEkpWGWeaO3q/t4Y6UTqGeEz kVgQ== X-Gm-Message-State: AHYfb5h9Vj4JGx6K7C6V/G4dg+Vt5VWbLx75j5nYc1GfBEKVT10koOyM 3hJIlAl/XIhIFi2+UtkH8Q== X-Received: by 10.84.167.2 with SMTP id c2mr18966445plb.368.1503308096213; Mon, 21 Aug 2017 02:34:56 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 69sm23355087pfh.186.2017.08.21.02.34.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 02:34:55 -0700 (PDT) From: Yuanhan Liu To: Pablo de Lara Cc: dpdk stable , Yuanhan Liu Date: Mon, 21 Aug 2017 17:30:36 +0800 Message-Id: <1503307878-16728-22-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> References: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'crypto/scheduler: fix strings not null terminated' has been queued to stable release 17.05.2 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: Mon, 21 Aug 2017 09:34:57 -0000 Hi, FYI, your patch has been queued to stable release 17.05.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 6c1033264bdc922eab8d50c2047b97cd170bb1cc Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 18 Jul 2017 02:41:15 +0100 Subject: [PATCH] crypto/scheduler: fix strings not null terminated [ upstream commit d040aca671708ce9cb21af87a1389d2230880d91 ] Coverity issue: 143431 Fixes: 31439ee72b2c ("crypto/scheduler: add API implementations") Signed-off-by: Pablo de Lara --- drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 14 ++++++++++++++ drivers/crypto/scheduler/rte_cryptodev_scheduler.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c index 319dcf0..88f8fc0 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c @@ -467,8 +467,22 @@ rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id, sched_ctx = dev->data->dev_private; + if (strlen(scheduler->name) > RTE_CRYPTODEV_NAME_MAX_LEN - 1) { + CS_LOG_ERR("Invalid name %s, should be less than " + "%u bytes.\n", scheduler->name, + RTE_CRYPTODEV_NAME_MAX_LEN); + return -EINVAL; + } strncpy(sched_ctx->name, scheduler->name, RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN); + + if (strlen(scheduler->description) > + RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN - 1) { + CS_LOG_ERR("Invalid description %s, should be less than " + "%u bytes.\n", scheduler->description, + RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN - 1); + return -EINVAL; + } strncpy(sched_ctx->description, scheduler->description, RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN); diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h index 2ba6e47..b250a58 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h @@ -116,6 +116,7 @@ struct rte_cryptodev_scheduler; * - 0 if the scheduler is successfully loaded * - -ENOTSUP if the operation is not supported. * - -EBUSY if device is started. + * - -EINVAL if input values are invalid. */ int rte_cryptodev_scheduler_load_user_scheduler(uint8_t scheduler_id, -- 2.7.4