mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhihao Cheng <chengzhihao1@huawei.com>
To: <shao.mingyin@zte.com.cn>, <richard@nod.at>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH 1/3] ubifs: gc: fix authentication node leak
Date: Mon, 2 Nov 2026 21:30:26 +0800	[thread overview]
Message-ID: <ee613d53-5275-64dc-716b-a87880f7d6e6@huawei.com> (raw)
In-Reply-To: <20261102195052961juHOv3LqlGtcYgvGv708m@zte.com.cn>

在 2026/11/2 19:50, shao.mingyin@zte.com.cn 写道:
> move_nodes() allocates the authentication node, writes it to the GC
> write-buffer and only frees it on the error paths.  Every GC pass that
> moves nodes on an authenticated file system therefore leaks
> ubifs_auth_node_sz() bytes.
> 
> Free the buffer after it has been written to the write-buffer.
> 
> Fixes: 6f06d96fdf62 ("ubifs: Add auth nodes to garbage collector journal head")
> Cc: stable@vger.kernel.org
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
> ---
> diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
> index 933c79b5cd6b..2b0f29423f48 100644
> --- a/fs/ubifs/gc.c
> +++ b/fs/ubifs/gc.c
> @@ -427,6 +427,7 @@ static int move_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb)
>   				kfree(auth);
>   				goto out;
>   			}
> +			kfree(auth);
>   
>   			ubifs_add_dirt(c, wbuf->lnum, ubifs_auth_node_sz(c));
>   		}
> .
> 


  reply	other threads:[~2026-11-02 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 11:50 shao.mingyin
2026-11-02 13:30 ` Zhihao Cheng [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-11-02 11:50 [PATCH 0/3] ubifs: fix an auth node leak and two error-handling bugs shao.mingyin
2026-11-02 12:12 ` [PATCH 1/3] ubifs: gc: fix authentication node leak shao.mingyin

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=ee613d53-5275-64dc-716b-a87880f7d6e6@huawei.com \
    --to=chengzhihao1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=shao.mingyin@zte.com.cn \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®