From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+26eedf3631650972f17c@syzkaller.appspotmail.com
Cc: amir73il@gmail.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-unionfs@vger.kernel.org,
miklos@szeredi.hu, syzkaller-bugs@googlegroups.com
Subject: [PATCH] ovl: fix memory leak in ovl_parse_param
Date: Sun, 12 Nov 2023 18:35:47 +0800 [thread overview]
Message-ID: <tencent_3FF186FD92C8C658498FEEEE6EDACC8BA706@qq.com> (raw)
In-Reply-To: <0000000000003c31650609ecd824@google.com>
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
next prev parent reply other threads:[~2023-11-12 10:44 UTC|newest]
Thread overview: 7+ 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 9:10 ` Amir Goldstein
2023-11-12 9:21 ` syzbot
2023-11-12 14:36 ` Amir Goldstein
2023-11-12 15:09 ` syzbot
2023-11-12 10:35 ` Edward Adam Davis [this message]
2023-11-12 14:36 ` [PATCH] ovl: fix " Amir Goldstein
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=tencent_3FF186FD92C8C658498FEEEE6EDACC8BA706@qq.com \
--to=eadavis@qq.com \
--cc=amir73il@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox