[PATCH] Endian swap ->count before handing over to the nx-842 compressor

Ram Pai linuxram at us.ibm.com
Sat Oct 31 09:13:12 AEDT 2015


The nx-842 compressor overshoots the output buffer corrupting memory. Verified
that the following patch the issue on a LE system.

Signed-off-by: Ram Pai <linuxram at us.ibm.com>
---
 drivers/crypto/nx/nx-842-powernv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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));
-- 
1.7.1



More information about the Linuxppc-dev mailing list