All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Edward Adam Davis <eadavis@qq.com>
Cc: syzbot+26eedf3631650972f17c@syzkaller.appspotmail.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-unionfs@vger.kernel.org, miklos@szeredi.hu,
	syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] ovl: fix memory leak in ovl_parse_param
Date: Sun, 12 Nov 2023 16:36:13 +0200	[thread overview]
Message-ID: <CAOQ4uxgVPMHJifBZdrFwn+HoUTrj2Ma9ixrwurvU+=MUYB1_Tg@mail.gmail.com> (raw)
In-Reply-To: <tencent_3FF186FD92C8C658498FEEEE6EDACC8BA706@qq.com>

On Sun, Nov 12, 2023 at 12:35 PM Edward Adam Davis <eadavis@qq.com> wrote:
>
> After failing to parse parameters in ovl_parse_param_lowerdir(), it is
> necessary to update ctx->nr with the correct nr before using
> ovl_reset_lowerdirs() to release l->name.
>
> Reported-and-tested-by: syzbot+26eedf3631650972f17c@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
>  fs/overlayfs/params.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c
> index ddab9ea267d1..1f73f0173015 100644
> --- a/fs/overlayfs/params.c
> +++ b/fs/overlayfs/params.c
> @@ -530,6 +530,7 @@ static int ovl_parse_param_lowerdir(const char *name, struct fs_context *fc)
>         return 0;
>
>  out_put:
> +       ctx->nr = nr;
>         ovl_reset_lowerdirs(ctx);
>
>  out_err:
> --
> 2.25.1
>

Thanks for the patch!

I prefer to fix it by eliminating the local vars instead of
syncing with them:

I've kept your commit message and tagged you as Co-authored-by:
https://github.com/amir73il/linux/commit/97d58994e880ccb19e1b9b935928538903fca41c

Thanks,
Amir.

      reply	other threads:[~2023-11-12 14:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-12  4:18 [syzbot] [overlayfs?] memory leak in ovl_parse_param syzbot
2023-11-12  5:16 ` [syzbot] [PATCH] Test " syzbot
2023-11-12  9:10 ` [syzbot] [overlayfs?] " Amir Goldstein
2023-11-12  9:21   ` syzbot
2023-11-12 14:36   ` Amir Goldstein
2023-11-12 15:09     ` syzbot
2023-11-12  9:25 ` [syzbot] [PATCH] Test " syzbot
2023-11-12 10:35 ` [PATCH] ovl: fix " Edward Adam Davis
2023-11-12 14:36   ` Amir Goldstein [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='CAOQ4uxgVPMHJifBZdrFwn+HoUTrj2Ma9ixrwurvU+=MUYB1_Tg@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=eadavis@qq.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=syzbot+26eedf3631650972f17c@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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 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.