From patchwork Fri Oct 30 22:45:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 7529791 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 59BAF9F37F for ; Fri, 30 Oct 2015 22:45:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98A5220306 for ; Fri, 30 Oct 2015 22:45:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A17732024F for ; Fri, 30 Oct 2015 22:45:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031671AbbJ3Wpo (ORCPT ); Fri, 30 Oct 2015 18:45:44 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:53036 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031670AbbJ3Wpo (ORCPT ); Fri, 30 Oct 2015 18:45:44 -0400 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Oct 2015 16:45:43 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 30 Oct 2015 16:45:42 -0600 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: linuxram@us.ibm.com X-IBM-RcptTo: linux-crypto@vger.kernel.org Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 34E373E4003E for ; Fri, 30 Oct 2015 16:45:42 -0600 (MDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9UMjgPi2949598 for ; Fri, 30 Oct 2015 15:45:42 -0700 Received: from d03av05.boulder.ibm.com (localhost [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9UMjfxW028574 for ; Fri, 30 Oct 2015 16:45:41 -0600 Received: from ram.oc3035372033.ibm.com (sig-9-65-212-78.ibm.com [9.65.212.78]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t9UMjalG028399 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Oct 2015 16:45:39 -0600 Date: Fri, 30 Oct 2015 15:45:36 -0700 From: Ram Pai To: Herbert Xu , "David S. Miller" , Linux Crypto Mailing List Cc: ddstreet@ieee.org, hbabu@us.ibm.com Subject: [PATCH] nx-842: Endian swap ->count before handing over to the nx-842 compressor Message-ID: <20151030224536.GB22549@ram.oc3035372033.ibm.com> Reply-To: Ram Pai MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15103022-0025-0000-0000-00001E64888F Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The nx-842 compressor overshoots the output buffer corrupting memory. Verified that the following patch fixes the issue on a little-endian system. Signed-off-by: Ram Pai --- drivers/crypto/nx/nx-842-powernv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c index 3750e13..3b80ea7 100644 --- a/drivers/crypto/nx/nx-842-powernv.c +++ b/drivers/crypto/nx/nx-842-powernv.c @@ -66,7 +66,7 @@ static void setup_indirect_dde(struct data_descriptor_entry *dde, unsigned int dde_count, unsigned int byte_count) { dde->flags = 0; - dde->count = dde_count; + dde->count = cpu_to_be32(dde_count); dde->index = 0; dde->length = cpu_to_be32(byte_count); dde->address = cpu_to_be64(nx842_get_pa(ddl));