]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
If we're passed garbage in malloc_init(), panic() rather than expecting
authorbrian <brian@FreeBSD.org>
Fri, 5 Jun 2009 09:16:52 +0000 (09:16 +0000)
committerbrian <brian@FreeBSD.org>
Fri, 5 Jun 2009 09:16:52 +0000 (09:16 +0000)
commit3f1308d2b54e9280f365e435a0c8910d48fb41ef
tree49838cc41951762d5ad9e7c30d84fc57cc64589d
parent81b8f443e2f4f8756cab6dc8720cd177833feead
If we're passed garbage in malloc_init(), panic() rather than expecting
a KASSERT to handle it.  People are likely to turn off INVARIANTS RSN
and loading an old module can cause garbage-in here.

I saw the issue with an older nvidia driver (x11/nvidia-driver) loading
into a new kernel - a crash wasn't seen 'till sysctl_kern_malloc_stats().
I was lucky that mtp->ks_shortdesc was NULL and not something horrible.

While I'm here, KASSERT that malloc_uninit() isn't passed something that's
not in kmemstatistics.

MFC after: 3 weeks
sys/kern/kern_malloc.c