Re: [PATCH RFC v3 26/44] xenfs: use fc_init_pseudo()

From: Alexander Mikhalitsyn

Date: Tue Nov 17 2026 - 03:28:43 EST


On Mon, 2026-11-16 at 12:04 +0100, Christian Brauner wrote:
> Initialize xenfs as a pseudo filesystem. This raises SB_I_PSEUDO and
> also SB_I_NOEXEC and SB_I_NODEV. xenfs never holds executables or
> device nodes.
>
> SB_I_NOEXEC also refuses PROT_EXEC mappings. xenfs maps the xenstore
> page and guest memory through privcmd, both data.
>
> Reviewed-by: Chris Down <chris@xxxxxxxxxxxxxx>

Reviewed-by: Alexander Mikhalitsyn <alex@xxxxxxxxxxxx>

> Signed-off-by: Christian Brauner (Amutable) <brauner@xxxxxxxxxx>
> ---
>  drivers/xen/xenfs/super.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c
> index 37ea7c5c03469..aba7d038ed735 100644
> --- a/drivers/xen/xenfs/super.c
> +++ b/drivers/xen/xenfs/super.c
> @@ -15,6 +15,7 @@
>  #include <linux/module.h>
>  #include <linux/fs.h>
>  #include <linux/fs_context.h>
> +#include <linux/pseudo_fs.h>
>  #include <linux/magic.h>
>  
>  #include <xen/xen.h>
> @@ -80,6 +81,7 @@ static const struct fs_context_operations
> xenfs_context_ops = {
>  
>  static int xenfs_init_fs_context(struct fs_context *fc)
>  {
> + fc_init_pseudo(fc);
>   fc->ops = &xenfs_context_ops;
>   return 0;
>  }