xfs
[Top] [All Lists]

Re: [PATCH] xfs: avoid double-free in xfs_attr_node_addname

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: Re: [PATCH] xfs: avoid double-free in xfs_attr_node_addname
From: Ben Myers <bpm@xxxxxxx>
Date: Tue, 13 Aug 2013 16:34:12 -0500
Cc: "'linux-xfs@xxxxxxxxxxx'" <linux-xfs@xxxxxxxxxxx>
Delivered-to: linux-xfs@xxxxxxxxxxx
In-reply-to: <51F9B77E.2030005@xxxxxxxxxx>
References: <51F9B77E.2030005@xxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Wed, Jul 31, 2013 at 08:18:54PM -0500, Eric Sandeen wrote:
> xfs_attr_node_addname()'s error handling tests whether it
> should free "state" in the out: error handling label:
> 
> out:
>         if (state)
>                 xfs_da_state_free(state);
> 
> but an earlier free doesn't set state to NULL afterwards; this
> could lead to a double free.  Fix it by setting state to NULL
> after it's freed.
> 
> This was found by Coverity.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

Applied.

<Prev in Thread] Current Thread [Next in Thread>