linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: youngjun <her0gyugyu@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	youngjun <her0gyugyu@gmail.com>
Subject: [PATCH] ovl: inode reference leak in "ovl_is_inuse" true case.
Date: Mon, 15 Jun 2020 08:56:45 -0700	[thread overview]
Message-ID: <20200615155645.32939-1-her0gyugyu@gmail.com> (raw)

When "ovl_is_inuse" true case, trap inode reference not put.

Signed-off-by: youngjun <her0gyugyu@gmail.com>
---
 fs/overlayfs/super.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 91476bc422f9..8837fc1ec3be 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1499,8 +1499,10 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
 
 		if (ovl_is_inuse(stack[i].dentry)) {
 			err = ovl_report_in_use(ofs, "lowerdir");
-			if (err)
+			if (err) {
+				iput(trap);
 				goto out;
+			}
 		}
 
 		mnt = clone_private_mount(&stack[i]);
-- 
2.17.1


             reply	other threads:[~2020-06-15 15:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 15:56 youngjun [this message]
2020-06-15 16:45 ` [PATCH] ovl: inode reference leak in "ovl_is_inuse" true case Amir Goldstein
2020-06-16  4:46 ` [PATCH] ovl: inode reference leak in ovl_is_inuse " youngjun
2020-06-16  5:33   ` Amir Goldstein
2020-06-16  6:57 ` [PATCH v3] " youngjun
2020-06-16  7:11   ` Amir Goldstein
2020-06-16  8:30 ` [PATCH 4/4] " youngjun
2020-07-14 14:40   ` Miklos Szeredi
2020-06-16  8:33 ` [PATCH v4] " youngjun

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=20200615155645.32939-1-her0gyugyu@gmail.com \
    --to=her0gyugyu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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;
as well as URLs for NNTP newsgroup(s).