($INBOX_DIR/description missing)
 help / color / 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	[flat|nested] 2+ messages in thread

* Re: [PATCH] ovl: credential not reverted in ovl_copy_up_flags on error case
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Amir Goldstein @ 2020-06-22 17:39 UTC (permalink / raw)
  To: youngjun; +Cc: Miklos Szeredi, overlayfs

On Mon, Jun 22, 2020 at 8:24 PM youngjun <her0gyugyu@gmail.com> wrote:
>
> 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;
> +       }
>

It is better to move ovl_override_creds() after the WARN_ON test.
which does not require any credentials.

Thanks,
Amir.

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

end of thread, back to index

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

($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