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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PUZPR04MB6316EBBEFB9F1878D1691E2481D5A@PUZPR04MB6316.apcprd04.prod.outlook.com>
Date: Fri, 21 Nov 2025 04:12:45 +0000
From: "Yuezhang.Mo@...y.com" <Yuezhang.Mo@...y.com>
To: Gao Xiang <hsiangkao@...ux.alibaba.com>,
        "linux-erofs@...ts.ozlabs.org"
	<linux-erofs@...ts.ozlabs.org>
CC: LKML <linux-kernel@...r.kernel.org>,
        "linux-fsdevel@...r.kernel.org"
	<linux-fsdevel@...r.kernel.org>,
        "syzbot+31b8fb02cb8a25bd5e78@...kaller.appspotmail.com"
	<syzbot+31b8fb02cb8a25bd5e78@...kaller.appspotmail.com>
Subject: Re: [PATCH] erofs: correct FSDAX detection

On November 17, 2025 19:57 Gao Xiang wrote:
> The detection of the primary device is skipped incorrectly
> if the multiple or flattened feature is enabled.
> 
> It also fixes the FSDAX misdetection for non-block extra blobs.
> 
> Fixes: c6993c4cb918 ("erofs: Fallback to normal access if DAX is not supported on extra device")
> Reported-by: syzbot+31b8fb02cb8a25bd5e78@...kaller.appspotmail.com
> Closes: https://lore.kernel.org/r/691af9f6.a70a0220.3124cb.0097.GAE@google.com
> Cc: Yuezhang Mo <Yuezhang.Mo@...y.com>
> Signed-off-by: Gao Xiang <hsiangkao@...ux.alibaba.com>
> ---
>  fs/erofs/super.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/erofs/super.c b/fs/erofs/super.c
> index f3f8d8c066e4..cd8ff98c2938 100644
> --- a/fs/erofs/super.c
> +++ b/fs/erofs/super.c
> @@ -174,15 +174,15 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,
>                 if (!erofs_is_fileio_mode(sbi)) {
>                         dif->dax_dev = fs_dax_get_by_bdev(file_bdev(file),
>                                         &dif->dax_part_off, NULL, NULL);
> -                       if (!dif->dax_dev && test_opt(&sbi->opt, DAX_ALWAYS)) {
> -                               erofs_info(sb, "DAX unsupported by %s. Turning off DAX.",
> -                                          dif->path);
> -                               clear_opt(&sbi->opt, DAX_ALWAYS);
> -                       }
>                 } else if (!S_ISREG(file_inode(file)->i_mode)) {
>                         fput(file);
>                         return -EINVAL;
>                 }
> +               if (!dif->dax_dev && test_opt(&sbi->opt, DAX_ALWAYS)) {
> +                       erofs_info(sb, "DAX unsupported by %s. Turning off DAX.",
> +                                  dif->path);
> +                       clear_opt(&sbi->opt, DAX_ALWAYS);
> +               }
>                 dif->file = file;
>         }
> 
> @@ -215,13 +215,13 @@ static int erofs_scan_devices(struct super_block *sb,
>                           ondisk_extradevs, sbi->devs->extra_devices);
>                 return -EINVAL;
>         }
> -       if (!ondisk_extradevs) {
> -               if (test_opt(&sbi->opt, DAX_ALWAYS) && !sbi->dif0.dax_dev) {
> -                       erofs_info(sb, "DAX unsupported by block device. Turning off DAX.");
> -                       clear_opt(&sbi->opt, DAX_ALWAYS);
> -               }
> -               return 0;
> +
> +       if (test_opt(&sbi->opt, DAX_ALWAYS) && !sbi->dif0.dax_dev) {
> +               erofs_info(sb, "DAX unsupported by block device. Turning off DAX.");
> +               clear_opt(&sbi->opt, DAX_ALWAYS);
>         }
> +       if (!ondisk_extradevs)
> +               return 0;

Hi Gao Xiang,

If using multiple devices, is there still file data on the primary device?
If the primary device only contains metadata, the primary device does not need
to support DAX.

> 
>         if (!sbi->devs->extra_devices && !erofs_is_fscache_mode(sb))
>                 sbi->devs->flatdev = true;
> --
> 2.43.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ