From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/hvm: Fix use-after-free introduced by c/s 428607a Date: Tue, 2 Feb 2016 10:48:32 +0000 Message-ID: <56B08980.8060607@citrix.com> References: <1454349419-18430-1-git-send-email-andrew.cooper3@citrix.com> <56B0964502000078000CD620@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56B0964502000078000CD620@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Corneliu ZUZU , Xen-devel List-Id: xen-devel@lists.xenproject.org On 02/02/16 10:43, Jan Beulich wrote: >>>> On 01.02.16 at 18:56, wrote: >> For safety, NULL out the pointers after freeing them, in an attempt to make >> mistakes more obvious in the future. > Except that NULLing isn't really adding that much safety, and we'd > be better off poisoning such pointers. Nevertheless ... NULLing the pointers would cause things like rtc_deinit() to always blow up when it followed the NULL pointer. IMO, we should unconditionally always NULL pointers when freeing a pointer which isn't in local scope. It would make issues such as these completely obvious. ~Andrew