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 [thread overview]
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
next reply other threads:[~2020-06-22 17:22 UTC|newest]
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 ` [PATCH] ovl: credential not reverted in ovl_copy_up_flags on error case 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
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).