From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH 2/2] xen/gntalloc: safely delete grefs in add_grefs() undo path Date: Mon, 8 Sep 2014 18:37:54 +0100 Message-ID: <540DE972.2000507@citrix.com> References: <1409667690-23914-1-git-send-email-david.vrabel@citrix.com> <1409667690-23914-3-git-send-email-david.vrabel@citrix.com> <54063C9A.9010503@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XR2t8-0008U8-OY for xen-devel@lists.xenproject.org; Mon, 08 Sep 2014 17:38:02 +0000 In-Reply-To: <54063C9A.9010503@oracle.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: Boris Ostrovsky , David Vrabel , xen-devel@lists.xenproject.org Cc: Daniel De Graaf , Dave Scott List-Id: xen-devel@lists.xenproject.org On 02/09/14 22:54, Boris Ostrovsky wrote: > On 09/02/2014 10:21 AM, David Vrabel wrote: >> If a gref could not be added (perhaps because the limit has been >> reached or there are no more grant references available). The undo >> path may crash because __del_gref() frees the gref while it is being >> used for a list iteration. > > Need to fix commit message above. > >> >> A comment suggests that using list_for_each_entry() is safe since the >> gref isn't removed from the list being iterated over, but it is freed >> and thus list_for_each_entry_safe() must be used. > > I don't read the comment in the code as if it implied anything about > safety. > > Other than that, for both patches > > Reviewed-by: Boris Ostrovsky Applied to stable/for-linus-3.17-b. Thanks David