linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Endian swap ->count before handing over to the nx-842 compressor
@ 2015-10-30 22:13 Ram Pai
  2015-11-02  1:24 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Ram Pai @ 2015-10-30 22:13 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, hbabu, nacc

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@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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Endian swap ->count before handing over to the nx-842 compressor
  2015-10-30 22:13 [PATCH] Endian swap ->count before handing over to the nx-842 compressor Ram Pai
@ 2015-11-02  1:24 ` Michael Ellerman
  2015-11-02 18:46   ` Ram Pai
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2015-11-02  1:24 UTC (permalink / raw)
  To: Ram Pai, linuxppc-dev; +Cc: hbabu, nacc

On Fri, 2015-10-30 at 15:13 -0700, Ram Pai wrote:

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

This seems like a bug fix, so it should go to stable shouldn't it? If so which
version(s) should it apply to?

And which commit introduced the breakage? Or has it always been broken?

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Endian swap ->count before handing over to the nx-842 compressor
  2015-11-02  1:24 ` Michael Ellerman
@ 2015-11-02 18:46   ` Ram Pai
  0 siblings, 0 replies; 3+ messages in thread
From: Ram Pai @ 2015-11-02 18:46 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, hbabu, nacc

On Mon, Nov 02, 2015 at 12:24:36PM +1100, Michael Ellerman wrote:
> On Fri, 2015-10-30 at 15:13 -0700, Ram Pai wrote:
> 
> > The nx-842 compressor overshoots the output buffer corrupting memory. Verified
> > that the following patch the issue on a LE system.
> 
> This seems like a bug fix, so it should go to stable shouldn't it? If so which
> version(s) should it apply to?
> 
> And which commit introduced the breakage? Or has it always been broken?

Mike,

	Please ignore this patch. I still run into corruption even after
	this patch.  I am looking into the issue. Will have a more
	comprehensive fix.

	BTW: it has always been broken AFAICT. I find the issue even
	with lzo software compression. So may be I am doing something
	wrong in my driver, or there is more fundamental issue. Will dig
	this further.

RP

> 
> cheers

-- 
Ram Pai

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-02 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-30 22:13 [PATCH] Endian swap ->count before handing over to the nx-842 compressor Ram Pai
2015-11-02  1:24 ` Michael Ellerman
2015-11-02 18:46   ` Ram Pai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).