Re: hardened malloc is big and slow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 31, 2022 at 10:19:51AM -0700, John Reiser wrote:
> > Bottom line opinion: hardened_malloc ... costs too much.
> 
> Attempting to be constructive: Psychologically, I might be willing to pay
> a "security tax" of something like 17%, partly on the basis of similarity
> to the VAT rate (Value Added Tax) in some parts of the developed world.

The comparison is being done incorrectly. Since hardened_malloc builds
both a lightweight and heavyweight library by default, and since I
already explained this and that the lightweight library still has
optional security features enabled, it doesn't seem to have been done in
good faith. My previous posts where I provided both concise and detailed
information explaining differences and the approach were ignored. Why is
that?

As I said previously, hardened_malloc has a baseline very hardened
allocator design. It also has entirely optional, expensive security
features layered on top of that. I explained in detail that some of
those features have a memory cost. Slab allocation canaries have a small
memory cost and slab allocation quarantines have a very large memory
cost especially with the default configuration. Those expensive optional
features each have an added performance cost too.

Measuring with 100% of the expensive optional features enabled and
trying to portray the performance of the allocator solely based on that
is simply incredibly misleading and disregards all of my previous posts
in the thread.

hardened_malloc builds both a lightweight and heavyweight library by
default. The lightweight library still has 2 of the optional security
features enabled. None of the optional security features is provided by
glibc malloc and if you want to compare the baseline performance then
none of those should be enabled for a baseline comparison.

Take the light configuration, disable slab allocation canaries and full
zero-on-free, and there you go.

I also previously explained that hardened_malloc does not include a
thread cache for security reasons inherent to the concept of a thread
cache. An array-based thread cache with out-of-line metadata would still
hurt security, but would be a more suitable approach than a free list
compromising the otherwise complete lack of inline metadata.

Compare hardened_malloc with the optional security features disabled to
glibc malloc and also to glibc malloc with tcache disabled. It's easy
enough to stick a thread cache onto hardened_malloc and if there was
demand for that I could implement it in half an hour. At the moment, the
current users of hardened_malloc don't want to make the sacrifice of
losing 100% reliable detection of invalid frees along with the many
other benefits lost by doing that.
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux