($INBOX_DIR/description missing)
 help / color / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: youngjun <her0gyugyu@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH] ovl: credential not reverted in ovl_copy_up_flags on error case
Date: Mon, 22 Jun 2020 20:39:58 +0300
Message-ID: <CAOQ4uxiv9jn=uyeev3_gdPwhZE__0PaorFk+jtyD15d73O6N9w@mail.gmail.com> (raw)
In-Reply-To: <20200622172155.73579-1-her0gyugyu@gmail.com>

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.

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 17:21 youngjun
2020-06-22 17:39 ` Amir Goldstein [this message]

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='CAOQ4uxiv9jn=uyeev3_gdPwhZE__0PaorFk+jtyD15d73O6N9w@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=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