From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
Goldwyn Rodrigues <rgoldwyn@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ocfs2: fix double free in user_cluster_connect()
Date: Tue, 23 Sep 2025 20:08:34 +0800 [thread overview]
Message-ID: <5416e506-e888-41b2-aea3-1155c74d91ea@linux.alibaba.com> (raw)
In-Reply-To: <aNKDz_7JF7aycZ0k@stanley.mountain>
On 2025/9/23 19:26, Dan Carpenter wrote:
> The user_cluster_disconnect() function frees "conn->cc_private" which is
> "lc" but then the error handling frees "lc" a second time. Set "lc" to
> NULL on this path to avoid a double free.
>
> Fixes: c994c2ebdbbc ("ocfs2: use the new DLM operation callbacks while requesting new lockspace")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Looks fine.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
> fs/ocfs2/stack_user.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
> index 765105f1ff8a..be0a5758bd40 100644
> --- a/fs/ocfs2/stack_user.c
> +++ b/fs/ocfs2/stack_user.c
> @@ -1011,6 +1011,7 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn)
> printk(KERN_ERR "ocfs2: Could not determine"
> " locking version\n");
> user_cluster_disconnect(conn);
> + lc = NULL;
> goto out;
> }
> wait_event(lc->oc_wait, (atomic_read(&lc->oc_this_node) > 0));
next prev parent reply other threads:[~2025-09-23 12:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 11:26 [PATCH] ocfs2: fix double free in user_cluster_connect() Dan Carpenter
2025-09-23 12:08 ` Joseph Qi [this message]
2025-09-23 12:52 ` Goldwyn Rodrigues
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=5416e506-e888-41b2-aea3-1155c74d91ea@linux.alibaba.com \
--to=joseph.qi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=dan.carpenter@linaro.org \
--cc=jlbec@evilplan.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@lists.linux.dev \
--cc=rgoldwyn@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.