($INBOX_DIR/description missing)
 help / color / Atom feed
From: youngjun <her0gyugyu@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-unionfs@vger.kernel.org, youngjun <her0gyugyu@gmail.com>
Subject: [PATCH] ovl: credential not reverted in ovl_copy_up_flags on error case
Date: Mon, 22 Jun 2020 10:21:55 -0700
Message-ID: <20200622172155.73579-1-her0gyugyu@gmail.com> (raw)

In "ovl_copy_up_flags" on disconnected dir case(error case),
credential not reverted.

Fixes: aa3ff3c152ff9("ovl: copy up of disconnected dentries")
Signed-off-by: youngjun <her0gyugyu@gmail.com>
---
 fs/overlayfs/copy_up.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 79dd052c7dbf..53daa54ac859 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -906,8 +906,10 @@ int ovl_copy_up_flags(struct dentry *dentry, int flags)
 	 * In this case, we will copy up lower inode to index dir without
 	 * linking it to upper dir.
 	 */
-	if (WARN_ON(disconnected && d_is_dir(dentry)))
+	if (WARN_ON(disconnected && d_is_dir(dentry))) {
+		revert_creds(old_cred);
 		return -EIO;
+	}
 
 	while (!err) {
 		struct dentry *next;
-- 
2.17.1


             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 17:21 youngjun [this message]
2020-06-22 17:39 ` 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=20200622172155.73579-1-her0gyugyu@gmail.com \
    --to=her0gyugyu@gmail.com \
    --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

($INBOX_DIR/description missing)

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-unionfs/0 linux-unionfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-unionfs linux-unionfs/ https://lore.kernel.org/linux-unionfs \
		linux-unionfs@vger.kernel.org
	public-inbox-index linux-unionfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-unionfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git