Re: [PATCH] crypto: Fix test in get_prng_bytes()

2009-10-12 Thread Roel Kluin
...@tuxdriver.com Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 3aa6e38..47995ae 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -192,9 +192,6 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx) int

[PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip()

2009-12-07 Thread Roel Kluin
Return the PTR_ERR of the correct pointer. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- drivers/crypto/geode-aes.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 4801162..12cf864 100644 --- a/drivers

Re: [PATCH] geode: PTR_ERR return of wrong pointer in fallback_init_cip()

2009-12-07 Thread Roel Kluin
Return the PTR_ERR of the correct pointer. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- This is correct however you missed one spot a few lines above that one. Sergey Mironov sent a patch a while ago unfortunatelly a mangled one and he hasn't resent it yet. Could you please look at [0

[PATCH] geode: Fix cip/blk confusion

2010-01-29 Thread Roel Kluin
crypto_cipher cip members were set where crypto_cipher blk members should have been, also the PTR_ERR of the wrong pointer was returned. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- This was already discussed in december/januari but I still cannot find it in mainline, was it lost? diff

Re: [PATCH] geode: Fix cip/blk confusion

2010-01-29 Thread roel kluin
On Fri, Jan 29, 2010 at 3:51 PM, Sebastian Andrzej Siewior sebast...@breakpoint.cc wrote: * Roel Kluin | 2010-01-29 14:32:56 [+0100]: This was already discussed in december/januari but I still cannot find it in mainline, was it lost? Isn't this patch [0] and [1] in Herbert's tree? If so

Re: [PATCH] geode: Fix cip/blk confusion

2010-01-30 Thread Roel Kluin
a crypto_cipher cip member was set where a crypto_cipher blk members should have been. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- I think my previous patch missed one blk to cip conversion in geode_setkey_cip(): Please send an incremental patch. Thanks! Ok, here's the missing part

Is kernel optimized with dead store removal?

2010-02-24 Thread Roel Kluin
According to http://cwe.mitre.org/data/slices/2000.html#14 due to optimization A call to memset() can be removed as a dead store when the buffer is not used after its value is overwritten. Does this optimization also occur during compilation of the Linux kernel? Then I think I may have found some

Re: [PATCH] sha: prevent removal of memset as dead store in sha1_update()

2010-02-25 Thread Roel Kluin
Also from that document: If you know how large the accessed memory is, you can add it as input or output but if this is not known, you should add memory. As an example, if you access ten bytes of a string, you can use a memory input like: {m( ({ struct { char x[10]; } *p = (void

[PATCH v1] compiler: prevent dead store elimination

2010-02-27 Thread Roel Kluin
, via e.g. asm( :: m(*(char*)p)), then the compiler _will_ skip scrubbing bytes beyond the first. This works with gcc-3.2.3 up to gcc-4.4.3. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- include/linux/compiler-gcc.h | 11 +++ include/linux/compiler-intel.h |2 ++ include/linux

[PATCH v2] compiler: prevent dead store elimination

2010-02-28 Thread Roel Kluin
, via e.g. asm( :: m(*(char*)p)), then the compiler _will_ skip scrubbing bytes beyond the first. This works with gcc-3.2.3 up to gcc-4.4.3. Thanks to Mikael Pettersson for this information. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- You forgot to credit Mikael Not intended, I first put

[PATCH v3] compiler: prevent dead store elimination

2010-03-03 Thread Roel Kluin
up to gcc-4.4.3. Many thanks to Mikael Pettersson and Andi Kleen. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- I used a trick to prevent the assembly for Itanium, defining fake_memory_use in instrinsics.h and checking its definition in string.c, but maybe there's a better way to do

[PATCH] crypto: dont return PTR_ERR() of wrong pointer

2010-12-31 Thread roel kluin
Fix a PTR_ERR() return of the wrong pointer Signed-off-by: Roel Kluin roel.kl...@gmail.com --- drivers/crypto/mv_cesa.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c index 7d279e5..c99305a 100644 --- a/drivers/crypto