Date: Fri, 23 Jul 2010 15:47:41 +0200 From: Ivan Voras <ivoras@freebsd.org> To: freebsd-arch@freebsd.org Subject: Re: Multi-zone malloc(9) Message-ID: <i2c6h5$3cv$1@dough.gmane.org> In-Reply-To: <AANLkTikoY8CuAF3DThBAXH_mu1QAuUWyRMtkaIomaoi7@mail.gmail.com> References: <AANLkTikoY8CuAF3DThBAXH_mu1QAuUWyRMtkaIomaoi7@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 07/22/10 18:54, mdf@FreeBSD.org wrote: > Occasionally we run into use-after-free and malloc'd buffer overrun > scenarios. When this happens it can be rather difficult to determine > what code is at fault, since e.g. every 64 byte allocation, regardless > of malloc type, comes from the same UMA zone. This means that an > overflow in M_TEMP will affect M_DEVBUF, etc. Adding multiple uma > zones for each bucket size means that we can hash on the malloc type's > shortdesc field so that there are fewer collisions and misused memory > from one malloc type only affects a subset of other malloc types. To what extent does something like this help? As I read it, you still have the problem of overflows from one allocation trashing data in some other random allocation, but now you also have to track which hash bucket is it in while debugging? And would this interfere with possible NUMA efforts? (because it sort of looks similar - hashing allocations to "zones", which in NUMA case would be per-CPU).
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?i2c6h5$3cv$1>