lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 07 Apr 2020 17:35:24 -0700 From: Joe Perches <joe@...ches.com> To: Matthew Wilcox <willy@...radead.org>, Waiman Long <longman@...hat.com> Cc: Andrew Morton <akpm@...ux-foundation.org>, David Howells <dhowells@...hat.com>, Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>, James Morris <jmorris@...ei.org>, "Serge E. Hallyn" <serge@...lyn.com>, linux-mm@...ck.org, keyrings@...r.kernel.org, linux-kernel@...r.kernel.org, Linus Torvalds <torvalds@...ux-foundation.org>, David Rientjes <rientjes@...gle.com> Subject: Re: [PATCH v3] mm: Add kvfree_sensitive() for freeing sensitive data objects On Tue, 2020-04-07 at 15:12 -0700, Matthew Wilcox wrote: > On Tue, Apr 07, 2020 at 04:45:45PM -0400, Waiman Long wrote: > > On 4/7/20 4:31 PM, Joe Perches wrote: > > > On Tue, 2020-04-07 at 16:03 -0400, Waiman Long wrote: > > > > +extern void kvfree_sensitive(const void *addr, size_t len); > > > Why should size_t len be required? > > > > > > Why not do what kzfree does and memset > > > the entire allocation? (area->size) > > > > If the memory is really virtually mapped, the only way to find out the > > size of the object is to use find_vm_area() which can be relatively high > > cost and no simple helper function is available. On the other hand, the > > length is readily available in the callers. So passing the length > > directly to the kvfree_sensitive is simpler. > > Also it lets us zero only the first N bytes of the allocation. That might > be good for performance, if only the first N bytes of an M byte allocation > are actually sensitive. I don't know if we have any such cases, but > they could exist. I would really doubt it as the allocation of sensitive data should generally be separate. Also, a similar argument could apply to kzfree/kfree_sensitive.
Powered by blists - more mailing lists