public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] malloc: Switch global_max_fast to uint8_t Date: Thu, 13 Oct 2022 04:18:38 +0000 (GMT) [thread overview] Message-ID: <20221013041838.4D9F73858C56@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=15a94e6668a6d7c5697e805d8d67f1d102d0d52e commit 15a94e6668a6d7c5697e805d8d67f1d102d0d52e Author: Florian Weimer <fweimer@redhat.com> Date: Thu Oct 13 05:45:41 2022 +0200 malloc: Switch global_max_fast to uint8_t MAX_FAST_SIZE is 160 at most, so a uint8_t is sufficient. This makes it harder to use memory corruption, by overwriting global_max_fast with a large value, to fundamentally alter malloc behavior. Reviewed-by: DJ Delorie <dj@redhat.com> Diff: --- malloc/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc/malloc.c b/malloc/malloc.c index 953183e956..2a61c8b5ee 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1757,7 +1757,7 @@ typedef struct malloc_chunk *mfastbinptr; #define set_contiguous(M) ((M)->flags &= ~NONCONTIGUOUS_BIT) /* Maximum size of memory handled in fastbins. */ -static INTERNAL_SIZE_T global_max_fast; +static uint8_t global_max_fast; /* Set value of max_fast.
reply other threads:[~2022-10-13 4:18 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221013041838.4D9F73858C56@sourceware.org \ --to=fw@sourceware.org \ --cc=glibc-cvs@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: linkBe 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).