Thread (88 messages) 88 messages, 13 authors, 2017-10-23

Re: Adjusting further size determinations?

From: SF Markus Elfring <hidden>
Date: 2017-10-18 13:50:54
Also in: kernel-janitors, linux-integrity, lkml

quoted
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.

quoted
and change:
	ptr = kmalloc(sizeof *ptr, flags);
to:
	KMALLOC(&ptr, flags);

But it is all churn for churn's sake.
Please don't.
Interesting …

Coccinelle won't find real problems with kmalloc any more if this is done.
The corresponding source code analysis will become different
(or more challenging) then. Are you still looking for related solutions?

Regards,
Markus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help