News for hackers. Stuff that matters.
Re:Further hardening glibc malloc() against single byte over... by bonzini on Thursday May 18, 2017 @02:46AM (#14365287)
You could do that at the compiler level, and only for types that end in a flexible array member, or only when malloc's argument looks like "sizeof (T) + x". That would generally avoid the space overhead, and in the flexible array member case you could e.g. add a whole int (4 byes) for an int-typed flexible array member. But I am not sure it's a good idea, for the other reason you mentioned.

There are no comments on this comment yet.