Re: [PATCH v2] mm: Add kvfree_sensitive() for freeing sensitive data objects
From: David Howells
Date: Tue Apr 07 2020 - 18:54:44 EST
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> > It might be worth asking the compiler folks to give us an __attribute__ for
> > that - even if they don't do anything with it immediately. So we might have
> > something like:
> >
> > void free(const volatile void *ptr) __attribute__((free(1)));
>
> Yeah, that sounds sane.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94527
> Even if it wasn't initially used for anything it wouldn't hurt, and maybe
> some day it would improve warnings (and allow the compiler to do the dead
> store elimination that started this whole long set of threads in the first
> place..)
With regard to this, I've got back "not sure what Linus was talking about WRT
DSE, if he's got examples he could pass along, they'd be appreciated"
David