Date: Tue, 5 Nov 2002 19:25:33 +0200 (EET) From: Iasen Kostov <ikostov@otel.net> To: freebsd-net@freebsd.org Subject: NFS functions does *NOT* check if they really have allocated any memory Message-ID: <20021105183154.I80368-100000@shadowhand.OTEL.net>
next in thread | raw e-mail | index | archive | help
As I experience system crushes at time of mbufs exhaustion I've compiled a debug kernel and traced the problem. I seems the NFS functions (nfsm_rpchead, nfsm_reqh ...) does *NOT* chek if they really have allocated memory by MGET macro. First problem that I saw was in nfsm_reqh at nfs/nfs_subs.c:593 (4.7-STABLE). I've added a check for mb == 0 - if so function just retuns NULL. But here raise another problem in "second level" functions - they don't check what lower level functions return , thus they crush kernel if the lower level functions return NULL. You could see it in nfs3_access_otw at nfs_vnops.c:293 - there is absent a check for value returned by nfsm_reqhead macro which calls nfsm_reqh(). I've looked at the other parts of kernel (drivers mainly) and I saw that after MGET allocations drivers check if they really have allocated mbufs (xl dirver) (which is not true for NFS :). Why NFS functions doesn't care if they really have allocated mbufs ? :), and I think they should care. regards To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021105183154.I80368-100000>