public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] malloc: Switch global_max_fast to uint8_t
Date: Wed, 12 Oct 2022 13:07:28 -0400	[thread overview]
Message-ID: <xn35bt7yy7.fsf@greed.delorie.com> (raw)
In-Reply-To: <87bkqhywbg.fsf@oldenburg.str.redhat.com>


set_max_fast() doesn't itself check the value passed to it, but it's
only ever called twice:  once at startup with a constant, and once from
tunables where the value is checked.

so we're only concerned with malicious overwriting, ok.

The wiki agrees that the maximum value on current targets is 160.

0..255 still allows corruption, but limits the corruption.  I suppose
with a 32 bit or 64 bit value we could currupt things to the point where
we could generate arbitrary addresses.  So I see how this limits the
attack surface.

I suspect with today's processors, reading an 8-bit value into a 32-bit
register adds no overhead.

Both INTERNAL_SIZE_T and uint8_t are unsigned, so there's no logic
changes there.

LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>


      reply	other threads:[~2022-10-12 17:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 14:02 Florian Weimer
2022-10-12 17:07 ` DJ Delorie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xn35bt7yy7.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).