From patchwork Tue Jun 6 08:00:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 103127 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1295034qgd; Tue, 6 Jun 2017 01:01:09 -0700 (PDT) X-Received: by 10.84.210.105 with SMTP id z96mr18321235plh.219.1496736069756; Tue, 06 Jun 2017 01:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496736069; cv=none; d=google.com; s=arc-20160816; b=FtpSMV2qeEpDVuCgqOrB5lcJEb1TvPO39rAuJXwARKpiKHT+Pv5SO3WaA6T1diNu0t udpjfq8jHn4nhKD5cdkqyk2wDWlKDL6KUm1cEX9oG4nCGtwgb9nZpLl0+T90zMC7jKqH vyehFEAbZA1RqU22Ha1HYJ0JxRwkcb+mVUro8VEkK9NRNpviuMCSnsbYZEBpkoVSYbJX sKhwUXcbl5fEXeFnKkWLAHFTS2k9a5RMWdW2TRrHdYqL6H6gNFzz021l7z/HeUjI76D8 XTj5ewB1RaBRar1MBZUDevd1WiOjc50VPyo5UfusU8LTMahHWMaFYAUbHLwXr98hSaYT 3w2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=K3TIkSNiO44X7ODoQqdiBpgP37o5aEmLK6B2XTYlFmo=; b=ksiH8l/zTvCxOw+HPsSACwcWObnhkZHr9koaDkNyn2/3fjvd5DkWwojdmtqOEGsHe/ 8WMBsZSUl2NEb7h1694hhW6CWMvIxXnt6dWJ+w8CPzKAl3roH2dXnyxxF22uCquaAEDJ Mn4mooIilFWjJHhXmZunqGuOAFv6ItjLZ9kgDK0eUOrOlYmDKJD1m1LlFIf3y4tERznm 5AI//Z0XX3EMITl3UtIbZkqzvaMNrTF9U6aaJ1Up5q6YL48ZxihQuRalQU+83fE8o2LX cMNRw3iDFFPYANFW9oYAvZnHiiXCC0PHKmYaTgRArLt0kkOVTB03hF/E1Co/36SAifvk JGZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si9561573pld.476.2017.06.06.01.01.09; Tue, 06 Jun 2017 01:01:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751194AbdFFIBE (ORCPT + 1 other); Tue, 6 Jun 2017 04:01:04 -0400 Received: from foss.arm.com ([217.140.101.70]:41814 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbdFFIBD (ORCPT ); Tue, 6 Jun 2017 04:01:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 168A22B; Tue, 6 Jun 2017 01:00:58 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 734013F578; Tue, 6 Jun 2017 01:00:56 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [BUGFIX PATCH] staging: ccree: fix buffer copy Date: Tue, 6 Jun 2017 11:00:45 +0300 Message-Id: <1496736045-29945-1-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix a bug where the copying of scatterlist buffers incorrectly ignored bytes to skip in a scatterlist and ended 1 byte short. This fixes testmgr hmac and hash test failures currently obscured by hash import/export not being supported. Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver"). Signed-off-by: Gilad Ben-Yossef --- Please roll this patch into 4.12-rc5 if possible. drivers/staging/ccree/ssi_buffer_mgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c index 038e2ff..6471d3d 100644 --- a/drivers/staging/ccree/ssi_buffer_mgr.c +++ b/drivers/staging/ccree/ssi_buffer_mgr.c @@ -216,7 +216,8 @@ void ssi_buffer_mgr_copy_scatterlist_portion( uint32_t nents, lbytes; nents = ssi_buffer_mgr_get_sgl_nents(sg, end, &lbytes, NULL); - sg_copy_buffer(sg, nents, (void *)dest, (end - to_skip), 0, (direct == SSI_SG_TO_BUF)); + sg_copy_buffer(sg, nents, (void *)dest, (end - to_skip + 1), to_skip, + (direct == SSI_SG_TO_BUF)); } static inline int ssi_buffer_mgr_render_buff_to_mlli(