[PATCH] malloc/malloc.c: Mitigate null-byte overflow attacks

DJ Delorie dj@redhat.com
Mon Oct 23 20:41:00 GMT 2017


I'm OK with the patch in theory, but...

unlink() is called from seven places; you have patched two.  Are the
other five open to this bug?  Perhaps it would be better to add another
parameter to the unlink() macro to centralize this check and enforce it
everywhere?

I wonder if we should add a "size_is_sane()" macro to check for
unreasonable sizes before we use them to compute pointers.

Also, your mailer is corrupting your patch; I had to apply it by hand to
review it.  It's wrapping lines and using 0xa0 spaces instead of 0x20.
Attaching it as inline-text might help, instead of just pasting it in to
the body.



More information about the Libc-alpha mailing list