linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ovl: credential not reverted in ovl_copy_up_flags on error case
@ 2020-06-22 17:21 youngjun
  2020-06-22 17:39 ` Amir Goldstein
  0 siblings, 1 reply; 2+ messages in thread
From: youngjun @ 2020-06-22 17:21 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-unionfs, youngjun

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-22 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 17:21 [PATCH] ovl: credential not reverted in ovl_copy_up_flags on error case youngjun
2020-06-22 17:39 ` Amir Goldstein

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).