lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOQ4uxgLhf8EyticTQUxtzUdVD=UEUTwQnTkujXE1KuaVxNQyQ@mail.gmail.com>
Date:   Tue, 18 Jul 2023 14:37:48 +0300
From:   Amir Goldstein <amir73il@...il.com>
To:     Yunlong Xing <yunlong.xing@...soc.com>
Cc:     miklos@...redi.hu, linux-unionfs@...r.kernel.org,
        linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        gregkh@...uxfoundation.org, sashal@...nel.org,
        yunlongxing23@...il.com, zhiguo.niu@...soc.com,
        hongyu.jin@...soc.com
Subject: Re: [PATCH] ovl: fix mount fail because the upper doesn't have space

On Tue, Jul 18, 2023 at 11:35 AM Yunlong Xing <yunlong.xing@...soc.com> wrote:
>
> The current ovlfs mount flow:
>
> ovl_fill_super
>  |_ovl_get_workdir
>     |_ovl_make_workdir
>        |_ovl_check_rename_whiteout
>
> In ovl_check_rename_whiteout(), a new file is attempted to create.But if
> the upper doesn't have space to do this, it will return error -ENOSPC,
> causing the mount fail. It means that if the upper is full, the overlayfs
> cannot be mounted.It is not reasonable, so this patch will omit this error
>  and continue mount flow.
>
> Fixes: cad218ab3320 ("ovl: check if upper fs supports RENAME_WHITEOUT")
> Signed-off-by: Yunlong Xing <yunlong.xing@...soc.com>
> ---
>  fs/overlayfs/super.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index 5b069f1a1e44..2cf41e978cff 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -744,9 +744,12 @@ static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs,
>
>         /* Check if upper/work fs supports RENAME_WHITEOUT */
>         err = ovl_check_rename_whiteout(ofs);
> -       if (err < 0)
> -               goto out;
> -
> +       if (err < 0) {
> +               if (err == -ENOSPC)
> +                       pr_warn("upper fs check RENAME_WHITEOUT fail due to no space.\n");
> +               else
> +                       goto out;
> +       }
>         rename_whiteout = err;
>         if (!rename_whiteout)
>                 pr_warn("upper fs does not support RENAME_WHITEOUT.\n");
> --

This assumes that RENAME_WHITEOUT is supported.
I rather assume it is not supported if the check fails.
Like this is shorter (not tested):

--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -744,12 +744,13 @@ static int ovl_make_workdir(struct super_block
*sb, struct ovl_fs *ofs,

        /* Check if upper/work fs supports RENAME_WHITEOUT */
        err = ovl_check_rename_whiteout(ofs);
-       if (err < 0)
+       if (err < 0 && err != -ENOSPC)
                goto out;

-       rename_whiteout = err;
+       rename_whiteout = err > 0;
        if (!rename_whiteout)
-               pr_warn("upper fs does not support RENAME_WHITEOUT.\n");
+               pr_warn("upper fs does not support RENAME_WHITEOUT (%i).\n",
+                       err);

Thanks,
Amir.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ