>> If you want 'security' for kmalloc() then:
>>
>> #define KMALLOC_TYPE(flags) (type *)kmalloc(sizeof (type), flags)
>> #define KMALLOC(ptr, flags) *(ptr) = KMALLOC_TYPE(typeof *(ptr), flags)
Such an approach might help.
>> and change:
>> ptr = kmalloc(sizeof *ptr, flags);
>> to:
>> K
On Wed, 18 Oct 2017, David Laight wrote:
> From: SF Markus Elfring
> > Unpleasant consequences are possible in both cases.
> > >> How much do you care to reduce the failure probability further?
> > >
> > > Zero.
> >
> > I am interested to improve the software situation a bit more here.
>
>
From: SF Markus Elfring
> Unpleasant consequences are possible in both cases.
> >> How much do you care to reduce the failure probability further?
> >
> > Zero.
>
> I am interested to improve the software situation a bit more here.
There are probably better places to spend your time!
If you
Unpleasant consequences are possible in both cases.
>> How much do you care to reduce the failure probability further?
>
> Zero.
I am interested to improve the software situation a bit more here.
Regards,
Markus
On Wed, 2017-10-18 at 13:00 +0200, SF Markus Elfring wrote:
> > Ugly grep follows:
> >
> > $ grep -rohP --include=*.[ch] "\w+\s*=\s*[kv].alloc\s*\(\s*sizeof.*," * | \
> > sed -r -e 's/(\w+)\s*=\s*[kv].alloc\s*\(\s*sizeof\s*\(\s*\*\s*\1\s*\)/foo
> > = k.alloc(sizeof(*foo))/' \
> > -e
>
> Ugly grep follows:
>
> $ grep -rohP --include=*.[ch] "\w+\s*=\s*[kv].alloc\s*\(\s*sizeof.*," * | \
> sed -r -e 's/(\w+)\s*=\s*[kv].alloc\s*\(\s*sizeof\s*\(\s*\*\s*\1\s*\)/foo =
> k.alloc(sizeof(*foo))/' \
> -e
> 's/(\w+)\s*=\s*[kv].alloc\s*\(\s*sizeof\s*\(\s*struct\s+\w+\s*\)/foo =