From: Jeff Liu <jeff.liu@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: fix possible double free in ocfs2_reflink_xattr_rec
Date: Tue, 06 Aug 2013 22:43:49 +0800 [thread overview]
Message-ID: <52010BA5.8090806@oracle.com> (raw)
In-Reply-To: <51FB602E.7000600@huawei.com>
On 08/02/2013 03:30 PM, Joseph Qi wrote:
> In ocfs2_reflink_xattr_rec(), meta_ac and data_ac are allocated by
> calling ocfs2_lock_reflink_xattr_rec_allocators().
> Once an error occurs when allocating *data_ac, it frees *meta_ac which
> is allocated before. Here it mistakenly sets meta_ac to NULL but
> *meta_ac. Then ocfs2_reflink_xattr_rec() will try to free meta_ac again
> which is already invalid.
>
> Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Looks good to me, thanks.
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
> ---
> fs/ocfs2/xattr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
> index 87daa44..bd2a1f0 100644
> --- a/fs/ocfs2/xattr.c
> +++ b/fs/ocfs2/xattr.c
> @@ -6799,7 +6799,7 @@ out:
> if (ret) {
> if (*meta_ac) {
> ocfs2_free_alloc_context(*meta_ac);
> - meta_ac = NULL;
> + *meta_ac = NULL;
> }
> }
>
prev parent reply other threads:[~2013-08-06 14:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 7:30 [Ocfs2-devel] [PATCH] ocfs2: fix possible double free in ocfs2_reflink_xattr_rec Joseph Qi
2013-08-06 14:43 ` Jeff Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52010BA5.8090806@oracle.com \
--to=jeff.liu@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox