SlideShare a Scribd company logo
2
Most read
4
Most read
5
Most read
FUSE
(Filesystem in Userspace)
      on OpenSolaris
        (2009/119)
PSARC Inception Review
March 25, 2009
William Krier


                            1
FUSE on OpenSolaris
    (2009/119)


●   What is FUSE
●   How FUSE Works
●   High Level Design Diagram
●   FUSE File System API
●   FUSE Protocol Specification
●   Security Concerns
    ● FUSE Mounts

    ● Privilege Escalation

    ● Block Device Access

    ● File System Access Control




                                   2
What Is FUSE
• FUSE is a framework which makes it possible to
  implement a filesystem in a userspace
  program.
• Features include:
   > simple yet comprehensive API
   > secure mounting by non-root users
   > multi-threaded operation
• Originally developed for Linux and currently
  runs on 2.4 and 2.6 Linux kernels
• Maintained at fuse.sourceforge.net
• Ported to FreeBSD (fuse4bsd) and Mac OS X
• FUSE library remains the same across platforms
                                                   3
How FUSE Works
• FUSE framework consists of 2 components
  > FUSE user space library (libfuse.so)
     – provides framework and exports FUSE API
  > FUSE kernel module
     – virtual file system (fusefs)
     – character device (/dev/fuse)
• FUSE kernel module redirects vfs calls to the
  FUSE library via the FUSE character device
• Example FUSE file systems
  > ntfs-3g
  > sshfs
  > davfs

                                                  4
High Level Design Diagram
                                FUSE Filesystem

            ls -l /mnt/fuse            libfuse

                 libc                    libc

userspace
kernel


                              fusefs             fusedev


                                        fuse module
                 VFS
                                          zfs

                                        nfsv2
                                                           5
How FUSE Works (cont.)
• FUSE kernel module registers with VFS.
• FUSE user space file system will link with FUSE
  library and provides:
   > Register file operation methods w/ library
      – struct fuse_operations
      – getattr, mknod, create, read, write, readdir,
        readlink, getdir, mknod, chmod, etc.
   > Mount point and options
• FUSE library calls the mount() system call
   > filesystem type is “fuse”
   > filehandle of /dev/fuse passed as option
• Filesystem calls are passed to FUSE library
  which invokes associated fuse operation in
  FUSE filesystem.                                      6
FUSE File System API
• FUSE file systems use the FUSE API
  specification to implement necessary file
  system operations
  > Current version of FUSE API is 2.7
  > Interface is classified as Volatile
  > The API is documented in
    FUSE_API_Specification.pdf




                                              7
FUSE Protocol Specification
• Kernel module communicates with FUSE library
  via the fuse character device
  > During mount, the library opens /dev/fuse
    and passes file descriptor to kernel.
  > The minor device number is associated with
    mount point via vfsp->vfs_dev
• Messages are passed via the FUSE device's
  read/write methods.
• FUSE messages are defined by the FUSE
  Protocol specification (version 7.8)
  > Protocol is classified as Project Private
  > Protocol is documented in
    FUSE_Protocol_Specification.pdf
                                                 8
FUSE Security Concerns
• Authorization for non-privileged users to
  perform file system mounts
• Privilege level escalation for non-privileged
  mounts
• Access to block devices for non-privileged
  mounts
• File system-specific access control




                                                  9
FUSE Mounts
• FUSE supports non-privileged mounts
• Accomplished by adding profile to
  /etc/security/prof_attr
  >   FUSE File System Management:::Mount and unmount FUSE filesystems:FUSE.html

• Consist of a single execution authorization in
  /etc/security/exec_attr
   > granting sys_mount privilege to FUSE
     mount/unmount programs
  >   FUSE File System Management:solaris:cmd:::/usr/bin/fusermount.bin:privs=sys_mount

• Profile must be manually added to users by
  administrator after installation.



                                                                                          10
Privilege Escalation
DoS Possibilities with Non-privileged Mounts
• FUSE file systems are only accessible to the
  user who mounted file system.
  > Prevents FUSE file system daemon from having
    ptrace-like capabilities and
  > Prevents denial of service for the requesting
    process (stalling system calls)
• Mount option to allow access to other non-root users
• Mount option to allow access to root




                                                         11
Block Device Access
• For FUSE file systems that are backed by block
  device (ie ntfs-3g)
• Non-root users must have read/write access to
  block device for non-privilege mount
• Create “fuse” group and add write-allow ACE
  for specific block device.
• Must be done manually by administrator.




                                                   12
File System Access Control
• By default, FUSE leaves all access control to the
  file system.
• Mount option to enable FUSE to enforce access
  control.
  > only allows UNIX-style permission checking,
     bypassing more sophisticated access controls
     that may be present in the file system.
  > does not have direct access to file permissions.
     (only see what file system presents)
• Disposition of file ownership varies by file system.
  > ntfs-3g presents owner as user who mounted fs.
  > sshfs presents owner as reported by remote
     host.
                                                         13
FUSE on OpenSolaris
(2009/119)

William Krier
William.Krier@sun.com



                        14

More Related Content

PPTX
Fuse- Filesystem in User space
PPTX
Windows Internals for Linux Kernel Developers
PDF
Linux Device Driver parallelism using SMP and Kernel Pre-emption
PDF
Solaris (Branded) Zone Internals
PDF
Trace kernel code tips
PDF
Making Linux do Hard Real-time
PDF
Intel DPDK Step by Step instructions
Fuse- Filesystem in User space
Windows Internals for Linux Kernel Developers
Linux Device Driver parallelism using SMP and Kernel Pre-emption
Solaris (Branded) Zone Internals
Trace kernel code tips
Making Linux do Hard Real-time
Intel DPDK Step by Step instructions

What's hot (20)

PDF
Block I/O Layer Tracing: blktrace
PDF
Openstack Instance Resize
PPT
Common linux ubuntu commands overview
PDF
Linux Komut Satırı
PDF
LISA2019 Linux Systems Performance
PDF
BUD17-416: Benchmark and profiling in OP-TEE
PPTX
Processing large volume of data with MuleSoft and salesforce.pptx
PDF
Continuous Go Profiling & Observability
PDF
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
PDF
PDF
Linux Yaz Kampı 2017 GNU/Linux Eğitim Dökümanı
PDF
BPF Internals (eBPF)
PDF
"Relax and Recover", an Open Source mksysb for Linux on Power
PDF
IPMI is dead, Long live Redfish
PDF
PPTX
A Kernel of Truth: Intrusion Detection and Attestation with eBPF
PDF
Heap exploitation
PPTX
Android audio system(audioflinger)
ODP
Introduction to Optee (26 may 2016)
PDF
Profiling your Applications using the Linux Perf Tools
Block I/O Layer Tracing: blktrace
Openstack Instance Resize
Common linux ubuntu commands overview
Linux Komut Satırı
LISA2019 Linux Systems Performance
BUD17-416: Benchmark and profiling in OP-TEE
Processing large volume of data with MuleSoft and salesforce.pptx
Continuous Go Profiling & Observability
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
Linux Yaz Kampı 2017 GNU/Linux Eğitim Dökümanı
BPF Internals (eBPF)
"Relax and Recover", an Open Source mksysb for Linux on Power
IPMI is dead, Long live Redfish
A Kernel of Truth: Intrusion Detection and Attestation with eBPF
Heap exploitation
Android audio system(audioflinger)
Introduction to Optee (26 may 2016)
Profiling your Applications using the Linux Perf Tools
Ad

Similar to FUSE (Filesystem in Userspace) on OpenSolaris (20)

PDF
FUSE Developing Fillesystems in userspace
PDF
An Introduction to User Space Filesystem Development
PDF
FUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
PDF
Python Fuse
PDF
PythonFuse (PyCon4)
PDF
Fuse'ing python for rapid development of storage efficient
PDF
Деградация производительности при использовании FUSE
PDF
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
PDF
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
PDF
Fun with FUSE
ODP
guadec_rlove_fuse_2006
PPT
Building File Systems with FUSE
PDF
All'ombra del Leviatano: Filesystem in Userspace
PDF
FUSE Filesystems
PDF
FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
PDF
The Linux Kernel Implementation of Pipes and FIFOs
PDF
Glusterfs session #18 intro to fuse and its trade offs
PDF
Writing flexible filesystems in FUSE-Python
PDF
Python & FUSE
PDF
Writing file system in CPython
FUSE Developing Fillesystems in userspace
An Introduction to User Space Filesystem Development
FUSE and beyond: bridging filesystems paper by Emmanuel Dreyfus
Python Fuse
PythonFuse (PyCon4)
Fuse'ing python for rapid development of storage efficient
Деградация производительности при использовании FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
KVEFS: Encrypted File System based on Distributed Key-Value Stores and FUSE
Fun with FUSE
guadec_rlove_fuse_2006
Building File Systems with FUSE
All'ombra del Leviatano: Filesystem in Userspace
FUSE Filesystems
FUSE and beyond: bridging filesystems slides by Emmanuel Dreyfus
The Linux Kernel Implementation of Pipes and FIFOs
Glusterfs session #18 intro to fuse and its trade offs
Writing flexible filesystems in FUSE-Python
Python & FUSE
Writing file system in CPython
Ad

More from elliando dias (20)

PDF
Clojurescript slides
PDF
Why you should be excited about ClojureScript
PDF
Functional Programming with Immutable Data Structures
PPT
Nomenclatura e peças de container
PDF
Geometria Projetiva
PDF
Polyglot and Poly-paradigm Programming for Better Agility
PDF
Javascript Libraries
PDF
How to Make an Eight Bit Computer and Save the World!
PDF
Ragel talk
PDF
A Practical Guide to Connecting Hardware to the Web
PDF
Introdução ao Arduino
PDF
Minicurso arduino
PDF
Incanter Data Sorcery
PDF
PDF
Fab.in.a.box - Fab Academy: Machine Design
PDF
The Digital Revolution: Machines that makes
PDF
Hadoop + Clojure
PDF
Hadoop - Simple. Scalable.
PDF
Hadoop and Hive Development at Facebook
PDF
Multi-core Parallelization in Clojure - a Case Study
Clojurescript slides
Why you should be excited about ClojureScript
Functional Programming with Immutable Data Structures
Nomenclatura e peças de container
Geometria Projetiva
Polyglot and Poly-paradigm Programming for Better Agility
Javascript Libraries
How to Make an Eight Bit Computer and Save the World!
Ragel talk
A Practical Guide to Connecting Hardware to the Web
Introdução ao Arduino
Minicurso arduino
Incanter Data Sorcery
Fab.in.a.box - Fab Academy: Machine Design
The Digital Revolution: Machines that makes
Hadoop + Clojure
Hadoop - Simple. Scalable.
Hadoop and Hive Development at Facebook
Multi-core Parallelization in Clojure - a Case Study

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Electronic commerce courselecture one. Pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
Teaching material agriculture food technology
PPTX
Spectroscopy.pptx food analysis technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Weekly Chronicles - August'25 Week I
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Machine learning based COVID-19 study performance prediction
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Electronic commerce courselecture one. Pdf
MYSQL Presentation for SQL database connectivity
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Encapsulation_ Review paper, used for researhc scholars
Programs and apps: productivity, graphics, security and other tools
Teaching material agriculture food technology
Spectroscopy.pptx food analysis technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

FUSE (Filesystem in Userspace) on OpenSolaris

  • 1. FUSE (Filesystem in Userspace) on OpenSolaris (2009/119) PSARC Inception Review March 25, 2009 William Krier 1
  • 2. FUSE on OpenSolaris (2009/119) ● What is FUSE ● How FUSE Works ● High Level Design Diagram ● FUSE File System API ● FUSE Protocol Specification ● Security Concerns ● FUSE Mounts ● Privilege Escalation ● Block Device Access ● File System Access Control 2
  • 3. What Is FUSE • FUSE is a framework which makes it possible to implement a filesystem in a userspace program. • Features include: > simple yet comprehensive API > secure mounting by non-root users > multi-threaded operation • Originally developed for Linux and currently runs on 2.4 and 2.6 Linux kernels • Maintained at fuse.sourceforge.net • Ported to FreeBSD (fuse4bsd) and Mac OS X • FUSE library remains the same across platforms 3
  • 4. How FUSE Works • FUSE framework consists of 2 components > FUSE user space library (libfuse.so) – provides framework and exports FUSE API > FUSE kernel module – virtual file system (fusefs) – character device (/dev/fuse) • FUSE kernel module redirects vfs calls to the FUSE library via the FUSE character device • Example FUSE file systems > ntfs-3g > sshfs > davfs 4
  • 5. High Level Design Diagram FUSE Filesystem ls -l /mnt/fuse libfuse libc libc userspace kernel fusefs fusedev fuse module VFS zfs nfsv2 5
  • 6. How FUSE Works (cont.) • FUSE kernel module registers with VFS. • FUSE user space file system will link with FUSE library and provides: > Register file operation methods w/ library – struct fuse_operations – getattr, mknod, create, read, write, readdir, readlink, getdir, mknod, chmod, etc. > Mount point and options • FUSE library calls the mount() system call > filesystem type is “fuse” > filehandle of /dev/fuse passed as option • Filesystem calls are passed to FUSE library which invokes associated fuse operation in FUSE filesystem. 6
  • 7. FUSE File System API • FUSE file systems use the FUSE API specification to implement necessary file system operations > Current version of FUSE API is 2.7 > Interface is classified as Volatile > The API is documented in FUSE_API_Specification.pdf 7
  • 8. FUSE Protocol Specification • Kernel module communicates with FUSE library via the fuse character device > During mount, the library opens /dev/fuse and passes file descriptor to kernel. > The minor device number is associated with mount point via vfsp->vfs_dev • Messages are passed via the FUSE device's read/write methods. • FUSE messages are defined by the FUSE Protocol specification (version 7.8) > Protocol is classified as Project Private > Protocol is documented in FUSE_Protocol_Specification.pdf 8
  • 9. FUSE Security Concerns • Authorization for non-privileged users to perform file system mounts • Privilege level escalation for non-privileged mounts • Access to block devices for non-privileged mounts • File system-specific access control 9
  • 10. FUSE Mounts • FUSE supports non-privileged mounts • Accomplished by adding profile to /etc/security/prof_attr > FUSE File System Management:::Mount and unmount FUSE filesystems:FUSE.html • Consist of a single execution authorization in /etc/security/exec_attr > granting sys_mount privilege to FUSE mount/unmount programs > FUSE File System Management:solaris:cmd:::/usr/bin/fusermount.bin:privs=sys_mount • Profile must be manually added to users by administrator after installation. 10
  • 11. Privilege Escalation DoS Possibilities with Non-privileged Mounts • FUSE file systems are only accessible to the user who mounted file system. > Prevents FUSE file system daemon from having ptrace-like capabilities and > Prevents denial of service for the requesting process (stalling system calls) • Mount option to allow access to other non-root users • Mount option to allow access to root 11
  • 12. Block Device Access • For FUSE file systems that are backed by block device (ie ntfs-3g) • Non-root users must have read/write access to block device for non-privilege mount • Create “fuse” group and add write-allow ACE for specific block device. • Must be done manually by administrator. 12
  • 13. File System Access Control • By default, FUSE leaves all access control to the file system. • Mount option to enable FUSE to enforce access control. > only allows UNIX-style permission checking, bypassing more sophisticated access controls that may be present in the file system. > does not have direct access to file permissions. (only see what file system presents) • Disposition of file ownership varies by file system. > ntfs-3g presents owner as user who mounted fs. > sshfs presents owner as reported by remote host. 13
  • 14. FUSE on OpenSolaris (2009/119) William Krier William.Krier@sun.com 14