> Instead of barrier(), this works with gcc-3.2.3 up to gcc-4.4.3
> for the purpose of making the memset() not disappear:
>
> {
> struct s { char c[n]; };
> asm("" : : "m"(*(struct s *)p));
> }
>
> Every byte in the [p,p+n[ range must be used. If you only u
Mikael Pettersson writes:
> Andi Kleen writes:
> > roel kluin writes:
> >
> > >> And it's wrong because the reason the memset() is there seems to be
> > >> to clear out key information that might exist kernel stack so that
> > >> it's more difficult for rogue code to get at things.
>
Andi Kleen writes:
> roel kluin writes:
>
> >> And it's wrong because the reason the memset() is there seems to be
> >> to clear out key information that might exist kernel stack so that
> >> it's more difficult for rogue code to get at things.
> >
> > If the memset is optimized away then
roel kluin writes:
>> And it's wrong because the reason the memset() is there seems to be
>> to clear out key information that might exist kernel stack so that
>> it's more difficult for rogue code to get at things.
>
> If the memset is optimized away then the clear out does not occur. Do you
> k
> 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 = (v
Op 25-02-10 18:32, Brian Gerst schreef:
> On Thu, Feb 25, 2010 at 12:09 PM, Mikael Pettersson wrote:
>> Brian Gerst wrote:
>>> Would barrier() (which is a simple memory clobber) after the memset work?
>>
>> I don't know. It's implemented as an asm with a "memory" clobber,
>> but I wouldn't bet on
On Thu, Feb 25, 2010 at 10:56 AM, Mikael Pettersson wrote:
> Roel Kluin writes:
> > Due to optimization A call to memset() may be removed as a dead store when
> > the buffer is not used after its value is overwritten.
> >
> > Signed-off-by: Roel Kluin
> > ---
> > see http://cwe.mitre.org/da
On Thu, Feb 25, 2010 at 5:16 PM, Pekka Enberg wrote:
> On Thu, Feb 25, 2010 at 5:56 PM, Mikael Pettersson wrote:
>> I fear that the only portable (across compiler versions) and safe
>> solution is to invoke an assembly-coded dummy function with prototype
>>
>> void use(void *p);
>>
>> and
Pekka Enberg writes:
> On Thu, Feb 25, 2010 at 5:56 PM, Mikael Pettersson wrote:
> > I fear that the only portable (across compiler versions) and safe
> > solution is to invoke an assembly-coded dummy function with prototype
> >
> > void use(void *p);
> >
> > and rewrite the code abo
On Thu, Feb 25, 2010 at 5:56 PM, Mikael Pettersson wrote:
> I fear that the only portable (across compiler versions) and safe
> solution is to invoke an assembly-coded dummy function with prototype
>
> void use(void *p);
>
> and rewrite the code above as
>
> {
> u32 te
Roel Kluin writes:
> Due to optimization A call to memset() may be removed as a dead store when
> the buffer is not used after its value is overwritten.
>
> Signed-off-by: Roel Kluin
> ---
> see http://cwe.mitre.org/data/slices/2000.html#14
>
> checkpatch.pl, compile and sparse tested. C
From: roel kluin
Date: Thu, 25 Feb 2010 16:31:36 +0100
> On Thu, Feb 25, 2010 at 4:17 PM, David Miller wrote:
>> From: Roel Kluin
>> Date: Thu, 25 Feb 2010 16:10:27 +0100
>>
>>> Due to optimization A call to memset() may be removed as a dead store when
>>> the buffer is not used after its value
On Thu, Feb 25, 2010 at 4:17 PM, David Miller wrote:
> From: Roel Kluin
> Date: Thu, 25 Feb 2010 16:10:27 +0100
>
>> Due to optimization A call to memset() may be removed as a dead store when
>> the buffer is not used after its value is overwritten.
>>
>> Signed-off-by: Roel Kluin
>
> Solution i
From: Roel Kluin
Date: Thu, 25 Feb 2010 16:10:27 +0100
> Due to optimization A call to memset() may be removed as a dead store when
> the buffer is not used after its value is overwritten.
>
> Signed-off-by: Roel Kluin
Solution is wrong and overkill in my mind.
It's overkill because the whole
Due to optimization A call to memset() may be removed as a dead store when
the buffer is not used after its value is overwritten.
Signed-off-by: Roel Kluin
---
see http://cwe.mitre.org/data/slices/2000.html#14
checkpatch.pl, compile and sparse tested. Comments?
diff --git a/crypto/sha1_generic.
15 matches
Mail list logo