Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Oct 2008 12:00:08 GMT
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/128304: vn_pollrecord() derefs NULL if v_addpollinfo() fails
Message-ID:  <200810231200.m9NC08jB052021@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/128304; it has been noted by GNATS.

From: Mateusz Guzik <mjguzik@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/128304: vn_pollrecord() derefs NULL if v_addpollinfo() fails
Date: Thu, 23 Oct 2008 13:57:43 +0200

 Hi.
 
 failure of uma_zalloc() would cause null pointer dereference in
 v_addpollinfo() anyway (due to mtx_init() call).
 
 From commit message for rev 1.142 of sys/vm/uma_core.c:
 
 Remove uma_zalloc_arg() hack, which coerced M_WAITOK to M_NOWAIT when
 allocations were made using improper flags in interrupt context.
 Replace with a simple WITNESS warning call.  This restores the
 invariant that M_WAITOK allocations will always succeed or die
 horribly trying, which is relied on by many UMA consumers.
 
 So it's ok to rely on M_WAITOK (which v_addpollinfo() does) and additional
 null check in vfs_kqfilter() can be removed as being meaningles.
 
 Thanks,
 --
 Mateusz Guzik



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810231200.m9NC08jB052021>