All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Miklos Szeredi" <mszeredi@redhat.com>
Cc: linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev
Subject: Re: [PATCH v3 6/9] fuse: add support for opening dax device as backing
Date: Tue, 06 Oct 2026 18:18:04 +0000	[thread overview]
Message-ID: <sashiko-outbox-162328@kernel.org> (raw)
In-Reply-To: <20261006180115.1425232-7-mszeredi@redhat.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Critical] fuse: FUSE_ATTR_DAX applied to non-regular files causes symlink DoS
- [High] fuse: sleep-in-atomic bug in fuse_backing_free() during RCU inode teardown
--

commit 122a624f241dd19a7e4f459c49f52f0a5d738881
Author: Miklos Szeredi <mszeredi@redhat.com>
Subject: fuse: add support for opening dax device as backing

This commit adds support for using a DAX device as a backing file in FUSE
passthrough mode. It introduces a new DAX backing type and marks the inode
with S_DAX if FUSE_ATTR_DAX is set during lookup.

> diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c
> index bc40818778dff..0ed850ddf8cde 100644
> --- a/fs/fuse/backing.c
> +++ b/fs/fuse/backing.c
[ ... ]
> @@ -22,9 +23,16 @@ static void fuse_backing_free(struct fuse_backing *fb)
>  {
>  	pr_debug("%s: fb=0x%p\n", __func__, fb);
>  
> -	if (fb->file)
> -		fput(fb->file);
> -	put_cred(fb->cred);
> +	switch (fb->type) {
> +	case FUSE_BACKING_PATH:
> +		path_put(&fb->path);
> +		put_cred(fb->cred);
> +		break;
> +
> +	case FUSE_BACKING_DAXDEV:
> +		fs_put_dax(fb->dax_dev, fb);
> +		break;
> +	}

[Severity: High]
Can path_put() or fs_put_dax() be called from atomic context here?

When the final reference is dropped during inode teardown in
fuse_free_inode(), it executes from the VFS RCU softirq callback
(i_callback).

If fuse_backing_put() is called from that RCU softirq context and drops
the final reference, invoking fuse_backing_free() synchronously, could
the sleeping functions path_put() and fs_put_dax() (which calls iput())
trigger a sleep-in-atomic bug?

>  	kfree_rcu(fb, rcu);
>  }
>  
[ ... ]
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index b5b51865d59f8..750e092c3971d 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
[ ... ]
> @@ -430,6 +434,11 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr,
>  	 */
>  	if (!fc->posix_acl)
>  		inode->i_acl = inode->i_default_acl = ACL_DONT_CACHE;
> +
> +	if ((attr->flags & FUSE_ATTR_DAX) && !fuse_inode_vdax(inode)) {
> +		inode->i_flags |= S_DAX;
> +		inode->i_data.a_ops = &fuse_dax_aops;
> +	}

[Severity: Critical]
Does this overwrite the address space operations for non-regular files
like symlinks?

If a FUSE server returns FUSE_ATTR_DAX on a symlink lookup, this code
unconditionally sets inode->i_data.a_ops = &fuse_dax_aops.

Since fuse_dax_aops does not implement a .read_folio callback, won't
this cause a NULL pointer dereference when a readlink() syscall attempts
to read the symlink (e.g., via fuse_get_link() -> page_get_link_raw() ->
read_mapping_folio())?

Should there be a check for S_ISREG(inode->i_mode) before setting the
DAX address space operations?

>  }
>  
>  static int fuse_inode_eq(struct inode *inode, void *_nodeidp)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261006180115.1425232-1-mszeredi@redhat.com?part=6

  reply	other threads:[~2026-10-06 18:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06 18:01 [PATCH v3 0/9] fuse: DAX device based extent maps (famfs) Miklos Szeredi
2026-10-06 18:01 ` [PATCH v3 1/9] dax: replace exported dax_dev_get() with non-allocating dax_dev_find() Miklos Szeredi
2026-10-06 18:10   ` sashiko-bot
2026-10-06 18:01 ` [PATCH v3 2/9] dax: use READ_ONCE() in dax_holder() Miklos Szeredi
2026-10-06 18:13   ` sashiko-bot
2026-10-08  1:02   ` Alison Schofield
2026-10-08  6:58     ` Miklos Szeredi
2026-10-06 18:01 ` [PATCH v3 3/9] fuse: add helpers for EIO return value with kernel message Miklos Szeredi
2026-10-06 21:03   ` Amir Goldstein
2026-10-06 18:01 ` [PATCH v3 4/9] fuse: support 64 bit, server allocated backing ID Miklos Szeredi
2026-10-06 18:20   ` sashiko-bot
2026-10-06 20:10   ` John Groves
2026-10-07 12:49     ` Miklos Szeredi
2026-10-06 22:08   ` Amir Goldstein
2026-10-07 12:54     ` Miklos Szeredi
2026-10-06 18:01 ` [PATCH v3 5/9] fuse: support opening 64 bit " Miklos Szeredi
2026-10-06 18:01 ` [PATCH v3 6/9] fuse: add support for opening dax device as backing Miklos Szeredi
2026-10-06 18:18   ` sashiko-bot [this message]
2026-10-06 18:01 ` [PATCH v3 7/9] fuse: add extent map data structure Miklos Szeredi
2026-10-06 18:17   ` sashiko-bot
2026-10-06 18:01 ` [PATCH v3 8/9] fuse: add extent map I/O support Miklos Szeredi
2026-10-06 18:22   ` sashiko-bot
2026-10-06 18:01 ` [PATCH v3 9/9] fuse: add support for striped backing Miklos Szeredi

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=sashiko-outbox-162328@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.