<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>February</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>VFSMon: an Innovative Reference Monitor in Linux</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Edoardo Manenti</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pasquale Caporaso</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giuseppe Bianchi</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francesco Quaglia</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Via del Politecnico</institution>
          ,
          <addr-line>n.1 - 00133, Roma, RM</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2025</year>
      </pub-date>
      <volume>0</volume>
      <fpage>3</fpage>
      <lpage>8</lpage>
      <abstract>
        <p>This paper introduces VFSMon, a path-based reference monitor that selectively protects files and device files in Linux. VFSMon operates at the Virtual File System (VFS) layer, ensuring independence from underlying file systems. VFSMon's key features include selective write access restrictions, time-based protection with resilient time management, and an embedded credential mechanism for configurable control over privileged users like root. Furthermore, VFSMon ofers place-holding paths, that can be exploited for common data management workflows based on production of (backup) files and their unmodificability for specific time windows. By protecting both pathname and device file access, VFSMon enhances security while supporting flexibility, providing a practical solution for safeguarding critical data against unauthorized modifications.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Linux</kwd>
        <kwd>Virtual File System</kwd>
        <kwd>Kernel Module</kwd>
        <kwd>Kernel Probes</kwd>
        <kwd>Reference Monitor</kwd>
        <kwd>Data Protection</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>A wide range of critical applications rely on the permanent recording of data. This need is especially
evident in contexts where backup images of virtual machines, file systems, and databases are fundamental
for responding to adverse events and ensuring that applications and services can be correctly restarted.</p>
      <p>
        At the same time, in most common scenarios, simply relying on ofline data copies is insuficient
to provide urgent data accessibility when specific events occur. As a result, data are often accessible
online, albeit behind protection mechanisms such as VPNs [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and authentication protocols [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>However, this approach increases the level of risk since the data are more exposed. Once an attacker—
such as a malicious insider—can manipulate applications on the operating system instance where the
data reside, the complete removal or encryption of that data becomes a genuine possibility.</p>
      <p>
        This problem has been long studied in the literature, and several solutions have been proposed to
attempt the prevention of unwanted data modifications. A few of them are suited for specific attacks,
like for example Ransomware and its typical data update pattern [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Other proposals operate at the
level of the file system where data are stored, and exploit additional attributes for files and directories,
like for example the “immutability" flag ( +i) in ext2/3/4 filesystems.
      </p>
      <p>
        Additional, proposals rely on Write-Once Read-Many (WORM) technology for the devices where
data are really stored [
        <xref ref-type="bibr" rid="ref4 ref5 ref6">4, 5, 6</xref>
        ]. Also, other solutions exploit the concept of reference monitor [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], and
embed within the reference monitor policies that prevent any thread, running on behalf of any user, to
overwrite or delete data in the file system.
      </p>
      <p>While each of these solutions has its own advantages, they also show limits. In particular, WORM
technology involves non-reusable storage blocks, protection based on data update patterns is essentially
a statistical technique, additional flags in the file system can be anyhow reset by threads running with
efective root-ID, and common reference monitors are not enough flexible to enable specific properties
in the data protection system. In this article we present an alternative solution named VFS-Monitor
(VFSMon), which combines features that characterize the diferent aforementioned techniques, while at
the same time counteracting their disadvantages.</p>
      <p>VFSMon is a software architecture we developed for integration in the Linux kernel, and is fully
based on the Linux Kernel Module (LKM) technology. It can be configured like a traditional reference
monitor, requiring that update operations on files and directories can be prevented at all (depending on
the security policies defined by the security administrator). At the same time it also ofers additional
mechanisms, which permit the setup of common workflows in data management, like the possibility to
include in the file system new data images (like database backups) which can be protected from updates
along a predefined time window—this is the classical workflow exploited for enabling the deletion of
older data copies that become no longer relevant at some point in time. All these activities can be
done through VFSMon with no need for any reconfiguration of parameters at run time, and with the
impossibility to make changes in the managed policies, even by root-ID threads.</p>
      <p>
        At the same time, VFSMon can also be setup with a less critical operating mode, enabling the
possibility of easy reconfigurations of the data protection rules, still relying on proper credentials that
do not coincide with the ones of the root user of the operating system—it therefore supports the notion
of security administrator, in a similar manner to the one used by commercial products like [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Also,
VFSMon is usable with any kind of file system to be mounted, being it an object essentially working at
the virtual level of the overall file system architecture, which expands its usability significantly.
      </p>
      <p>The remainder of this article is structured as follows. In Section 2 we discuss related work. In Section
3 we present VFSMon. A study on the overhead introduced by the proposed solution is provided in
Section 4. Conclusions are discussed in Section 5.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        One of the main problems when dealing with data kept at the file system level are Ransomware attacks
[
        <xref ref-type="bibr" rid="ref10 ref9">9, 10</xref>
        ]. Solutions oriented to tackling this type of attacks are either based on the inclusion of file
recoverability at the file system level [
        <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
        ] or on the delayed flushing of updated data from the
page-cache to the actual hard drive [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The recovery support, or the suspended flush, are maintained
until threads are still under judgment of their activities, and in any case not beyond a time limit. Our
VFSMon proposal works in a diferent manner, since it can support the unmodificability of data for
time windows whose length is independent from thread activities in the system. This allows supporting
specific data management workflows in a more suitable manner.
      </p>
      <p>
        Another technique for preventing data alteration or deletion, has traditionally relied on WORM
(Write-Once Read-Many) device technologies [
        <xref ref-type="bibr" rid="ref4 ref5 ref6">4, 5, 6</xref>
        ]. Our VFSMon solution stands apart from these
approaches, since it purely operates at the software level, particularly at the level of the virtual file
system, eliminating the need for any specialized hardware investment.
      </p>
      <p>
        A recent solution able to tackle both Ransomware and insider attacks is VaultFS [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], which is a
Linux oriented file system that enables a single session write activity on files. Each file can therefore
remain stable after it is created, e.g., by some backup generation system. One core diference between
VaultFS and our VFSMon solution is that the former operates on a file system that needs to reside on a
physical device—and that is managed by a specific driver, while VFSMon works on any file/directory
belonging to whichever file system, including the ones that are embedded within device files residing
on a diferent file system (like those manageable via the -o loop driver). Furthermore, working at the
level of the virtual file system, our solution stands above any file system specific driver, being therefore
compatible with diferentiated data management solutions ofered at the level of the operating system.
      </p>
      <p>
        The Linux kernel also ofers FS-VERITY [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], a feature that provides transparent integrity and
authenticity protection for read-only files. It operates by constructing a Merkle tree over the content
of a file, allowing the system to verify any read operation against this tree to detect unauthorized
modifications that might have occurred. This mechanism ensures that if any part of the file has been
altered, the verification process will fail, thereby preventing the compromised data from being used.
While this solution is extremely useful for blocking the usage of programs—like libraries—that can have
been altered (modified) by whatever attack, it doesn’t block modifications, which can anyhow take
place. VFSMon ofers protection against modification, for time windows that can be predefined by the
security administrator (ideally they can have infinite length).
      </p>
      <p>
        Security-Enhanced Linux (SELinux) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] is a robust security framework that provides a mechanism
for supporting access control security policies, including mandatory access control (MAC). It operates
on a whitelisting approach, enforcing security through comprehensive policies that define what actions
are explicitly permitted. In SELinux, everything not expressly allowed is denied by default. On the
opposite side, VFSMon relies on a blacklisting approach, thus enabling the easy definition of borders
for security. Also, SELinux’s policies are generally static—this is the way it uses in order to guarantee
MAC—which can be a drawback in environments where security requirements can change—like for
example depending on the age of a specific file. VFSMon, on the other hand, also ofers time-based
protection for both files and directories. Hence, administrators can easily enforce access control during
specific time frames, making VFSMon highly adaptable to varying operational contexts. Additionally, a
feature that distinguishes VFSMon is that is can be setup to manage protection for file system paths of
objects that do not already exist. Once they will be created, they will keep their update protection for
the predetermined time window.
      </p>
      <p>Finally, being VFSMon oriented to MAC protection, it can prevent threads that run with root-ID to
carry out any operation that can damage the content of critical (hence protected) data. Several supports
for Access Control List (ACL) ofered by common implementations of file systems—like it occurs for
example for ext4—do not reach this level of operations, since their setup can be anyhow subverted by
root-ID threads running in the system.</p>
      <p>Table 1 summarizes a high-level comparison of the discussed solutions.</p>
    </sec>
    <sec id="sec-3">
      <title>3. VFSMon</title>
      <sec id="sec-3-1">
        <title>3.1. Architectural Overview</title>
        <p>As mentioned, the architecture of VFSMon is fully embedded within a LKM. In order to gain control
when specific calls to the services of the virtual file system are issued, VFSMon exploits the KPROBE
support ofered by Linux. In particular, upon inserting the LKM, it installs probes on specific points in
the kernel in order to intercept the occurrence of specific events.</p>
        <p>This part of the architecture directly exploits results that are ofered by Linux to explicitly support
security frameworks. In particular, the probes installed by VFSMon are placed on all the hooks already
present in Linux for supporting the Linux Security Module (LSM) technology, which are destined to
ifle system management. These hooks can be seen in Table 2, where we also show the ret-probes we
installed, and synthesize their activities. Although we used ret-probes, our design and implementation
exploits both the entry and exit interceptions of the services ofered by ret-probes.</p>
        <p>The objective of the interception that is carried out by our kernel probes, applied to the listed hooks,
is the one of determining if an operation that is requested at the file system level is compatible with the
current file-system management state that is kept by VFSMon.</p>
        <p>Hooked Function</p>
        <p>↓</p>
        <p>Kretprobe
security_file_open</p>
        <p>↓
krp_security_file_open
security_inode_rename</p>
        <p>↓
krp_security_inode_rename
security_inode_unlink</p>
        <p>↓
krp_security_inode_unlink
security_inode_rmdir</p>
        <p>↓
krp_security_inode_rmdir
security_inode_create</p>
        <p>↓
krp_security_inode_create
security_inode_mkdir</p>
        <p>↓
krp_security_inode_mkdir
security_inode_link</p>
        <p>↓
krp_security_inode_link
security_inode_symlink</p>
        <p>↓
krp_security_inode_symlink</p>
        <p>Description of probe activities
Intercepts file opens on protected paths. If a file is opened for
writing and is protected, the operation is blocked and logged.</p>
        <p>Intercepts rename operations. Blocks and logs attempts
involving protected paths, ensuring no bypass through</p>
        <p>renaming.</p>
        <p>Intercepts file deletions. Blocks and logs removal attempts on</p>
        <p>protected files.</p>
        <p>Intercepts directory removals. Blocks and logs attempts to</p>
        <p>remove protected directories.</p>
        <p>Intercepts file creation in protected directories. Blocks and</p>
        <p>logs unauthorized creations.</p>
        <p>Intercepts directory creation in protected directories. Blocks</p>
        <p>and logs these attempts.</p>
        <p>Intercepts hard link creation. Blocks and logs operations</p>
        <p>involving protected files or directories.</p>
        <p>Intercepts symlink creation referencing protected paths.</p>
        <p>Blocks and logs these attempts to prevent indirect access.</p>
        <p>Such a state is characterized by a set of path-names. These path-names are not embedded in any
real file-system structure, hence they do not require any management at the level of i-nodes and
i-node caches. Rather, they are maintained by VFSMon in an apposite memory area. Currently, for the
organization of this area, we have exploited hash-tables, which are already supported by the Linux
kernel, in order to provide non-time-consuming operations when the search of a specific path-name
needs to be carried out by the kernel probes of VFSMon.</p>
        <p>These path-names are included in a set—which we simply refer to as Protected-Paths—and the
passage in any of the above listed hooks—hence in any of the kernel probes—can take place with no real
intervention by VFSMon only if the file/directory name involved in the requested operation—the one
that leads to activating the hook—is not actually registered in the Protected-Paths set kept by VFSMon.</p>
        <p>If the path-name is registered, then any attempt to execute file-system operations that can provide
the ability to update (e.g. write) on the file or the directory is denied by VFSMon. For example, the
opening of an I/O session on a file with write capability is denied. This is the baseline mechanism ofered
by VFSMon in terms of data protection, but as we will discuss in the successive sections, additional
facilities are supported to enable the efective use of VFSMon when specific workflows, in terms of data
management, need to be supported.</p>
        <p>The Protected-Path set can be configured in VFSMon in two diferent manners:
- Purely at startup: in this case VFSMon is configured as a pure reference monitor ofering pure
MAC support for the access to files/directories, and no user is permitted to execute any action
in terms of modifications (insertions/deletions) of the Protected-Paths set. This set is therefore
hard-coded in the setup data of VFSMon;
- At runtime: the reconfiguration can be put in place—in particular VFSMon supports it via an
ioctl(...) service.</p>
        <p>However, while the scenario ofering runtime reconfiguration does not represent a pure MAC
operating mode, in VFSMon the reconfiguration can be put in place only relying on a couple of keys
&lt; 1, 2 &gt;—of which 2 needs to be passed in input to the ioctl(...)—such that:
- 1 is the ID of a specific user—not necessarily coinciding with the root-user—which was setup in
the LKM at its startup. This ID must correspond with the actual user-ID of the thread that runs
the ioctl(...) command, otherwise any reconfiguration is denied by VFSMon by default.
- 2 is a password, whose encrypted version is maintained internally by VFSMon.</p>
        <p>By the above description, even under the scenario where the reconfiguration based on the
ioctl(...) is supported (i.e., when VFSMon is not under pure MAC operations), any possible
attacker that acquired the ID of the enabled user needs to have already tampered the usage of the
setuid(...) service, hence requiring to tamper some other application running under
(efective)rootID. This anyhow provides an additional level of protection, which is combined with the protection
ofered by the encrypted password 2 kept by VFSMon. Overall, the &lt; 1, 2 &gt; couple identifies that
operations are executed by a specific security administration user, which can operate reconfigurations
only if non-pure MAC operating mode has been setup for VFSMon.</p>
        <p>As hinted before, a file/directory used at the virtual file system level is managed via specific security
policies ofered by VFSMon only if it is included in Protected-Paths. However, this set of protected
ifle/directory names has no direct relation with the actual data representing the file, and its i-node
information. In particular, any information kept by VFSMon is fully external to the actual file systems
where protected stuf is located.</p>
        <p>Concerning this point, one core aspect that characterizes modern virtual file system architectures is
that a same file content can be reachable by exploiting several diferent path-names. This is for example
what takes place when using hard-links. In our kernel probes, we prevent the possibility to install
a new hard-link to an existing file whose path-name is currently kept in Protected-Paths. This only
leaves out of protection files which already have some unprotected hard-link in the file system when
VFSMon starts protecting another hard-link to the same file. Also, the protection ofered by VFSMon
for avoiding the installation of hard-links also copes with privilege escalation, since such installation is
prevented for (efective)root-ID threads too.</p>
        <p>However, another aspect appears to be more critical in relation to the possibility to rely on multiple
path-names for reaching a same content. It is related to bind-mount operations that can be executed by
the root-ID user. These are not based on hard-links, but rather they rely on the classical mount(...)
system call. To cope with this aspect, we installed a kernel probe also on the mount(...) system call
service ofered at kernel level. Each time it is invoked, a check is performed by VFSMon to determine if
the new path for reaching stuf in the bind-mounted file system can lead to reach an object that already
has its corresponding path in the Protected-Paths set. If this is the case, the new path to be protected is
automatically inserted by VFSMon in Protected-Paths, and is also automatically removed when the
unmount of the original bind-mount operation takes place. We think this kind of protection is relevant
still in relation to privilege escalation based attacks, when some (efective)root-ID thread can operate
calls to the mount(...) service ofered by the kernel.</p>
        <p>Additionally, considering the possibility of working with namespaces at the level of the virtual file
system, the Protected-Paths ofered by VFSMon is used, in terms of application of protection policies to
the corresponding files/directories, independently of the current namespace the applications are working
in—this is how we have designed our kernel probes. This automatically leads to the possibility to exploit
a single setup of the content of the Protected-Paths set to actually protect the same files/directories
that stand in diferent containers managed by the underlying operating system kernel.</p>
        <p>In Figure 1 we show the architecture of VFSMon, details of which will be further discussed in the
following sections.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Time Passage and Protected-Path Placeholding</title>
        <p>In many general purpose workflows, some of the sensible data that was protected at a time  may be not
sensible at a time  +  and would just result in a waste of memory given the fact that removal would
not be allowed. To cope with this scenario, a cardinal aspect of our system is indeed in the concept of
“time to live" (TTL) associated with path protection. Essentially, it represents the time span in which
the path needs to stay protected and the file/directory associated with it cannot be modified. This TTL
information is added by VFSMon to the protection metadata associated with a path in the used data
structures. Of course it is still possible to set the time as infinite, which means that, until VFSMon is up,
the file/directory will never be modifiable or deleted unless it is unprotected explicitly by the VFSMon
security administrator.</p>
        <p>However, in relation to the actual means for measuring the passage of time in VFSMon, our objective
is the one of defending ourselves from attackers that are assumed to have escalated privileges—hence
they can run (efective)root-ID thread. Therefore they can even be able to change date and time of the
system.</p>
        <p>Considering this aspect, we decided not to rely on any retrieval of time information to avoid creating
security weaknesses and introduce possible protection bypasses. Hence, we decided to include in
VFSMon a kernel daemon setup by the same VFSMon initialization block. The daemon basically
triggers itself at regular intervals, exploiting relative-timeouts along the actual time passage via the
High-Resolution-Timer (HRT) interrupt architecture. The only tasks run by this daemon are 1) the
update of a VFSMon-internal counter that would then represent the VFSMon time and 2) the loop on
Protected-Paths checking for TTL and eliminating paths when their TTL expires.</p>
        <p>However, VFSMon not only ofers the possibility to rely on TTL for reporting a file/directory into
the traditional state in terms of its management—with no update protection still enforced. Rather, it
also supports the management of a protected path associated with a file not yet existing. In particular, a
protected path can be marked in its metadata as a place-holding one. Each of these paths is anyhow
associated with a TTL (infinite or not), and will be protected for avoiding the opening of I/O sessions
with write capabilities. However, this protection will start at the time instant where the first write
session on the file is opened (and is intercepted by our probes). This means that a single session for
updating the file is guaranteed to be supported, and after setting it up, new data on the file can only
be placed passing through that specific I/O session. Combining this capability of VFSMon with the
management of TTL enables the user to put in place workflows where specific files are allowed to be
created (and populated) for keeping critical data that are guaranteed to be unmodifiable for a selected
time window. This is the classical workflow related to backup procedures (of databases, virtual clusters,
etc.) on an common operating site.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Managing Devices</title>
        <p>In a modern data management system, the presence of block devices, including logical ones—like,
regular files representing the device file of, e.g., virtual machine or container file systems—is crucial.
Hence, providing support for the management of block devices and device files, according to their
common usage—they ofer file systems to be mounted—is another interesting objective.</p>
        <p>By construction, in VFSMon a device (or device file) that cannot be written since its path-name is kept
in Protected-Path, cannot be opened in write mode by any driver. However, this scenario is somehow
restrictive of the real usage one can imagine for the hosted file system. In particular, a more flexible
scenario would be the one where the device (or device file) is protected from updates that can occur on
the file system where it is recorded, but operations in its hosted file system can anyhow occur.</p>
        <p>VFSMon ofers the possibility to support such flexible scenario. In particular, an element in
ProtectedPath is also marked with an additional flag that tells if a mount operation targeting that device file can
be executed, also considering write-mode while mounting. This flag is managed by our probes of the
mount service (see Figure 1). Hence, when the actual open operation takes place in the device driver,
we recognize that the execution flow has passed through the mount task and we can enable file system
mounting.</p>
        <p>Clearly, the content of Protected-Paths still applies to files in the file system hosted on the device (or
device file). Hence, VFSMon supports the scenario where file systems hosted on devices (or device files)
are mounted because of the activation of, e.g. containers, and their internal content still undergoes the
protection policies natively ofered by VFSMon.</p>
        <p>At the technical level, this means that these devices are only accessible through the operating system
page-cache, but are not accessible as common streams on the file system where they reside. This is
an additional feature that distinguishes VFSMon from common file management services ofered by
operating systems.</p>
      </sec>
      <sec id="sec-3-4">
        <title>3.4. Security Assessment</title>
        <p>Based on the explained details, we can say that our system, once in operation, succeeds in preventing
any changes to protected files/directories by ensuring integrity for the required time (see TTL in
Section 3.2). Integrity is guaranteed also in face of arbitrary commands or software execution by any
(efective)root-ID attacker, since VFSMon supports MAC policies.</p>
        <p>This is possible also because of some measures that have been taken for a release of VFSMon, such
as not providing a cleanup_module function for a possible attacker to unmount the module under
privilege escalation.</p>
        <p>At the same time, the operations by VFSMon are guaranteed to work correctly unless the kernel
probes it adopts are removed, or its internal modules fall under installation of additional probes that
operate on them—changing their behavior. This requires anyhow tasks that cannot be executed, even
under privilege escalation, except if a malicious Linux kernel module making these tasks is mounted.
To protect against this scenario, VFSMon can be used under secure-boot constraints, leading to the
impossibility to mount arbitrary Linux kernel modules that are not guaranteed to be trusted.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Run-time Cost</title>
      <sec id="sec-4-1">
        <title>4.1. Testing Methodology</title>
        <p>In this section, we present experimental data illustrating the run-time overhead introduced by VFSMon.
We first describe the testing methodology, then we discuss the obtained results.</p>
        <p>We constructed a test framework using Python and C, capable of timing file operations using the Time
Stamp Counter (TSC) for cycle-accurate measurements. We measured the time taken for file open(...)
operations in various modes (O_RDONLY, O_WRONLY, O_CREAT | O_TRUNC | O_WRONLY) both with
and without VFSMon while running diferentiated workloads by varying the number of threads and
protected paths.</p>
        <p>At first we conducted a baseline test without the presence of VFSMon, measuring the inherent latency
of file operations under normal conditions and then, after mounting the module, we run the tests again,
saving the new measurements. In particular, each test configuration was repeated 200 times, with
each repetition performing 1000 iterations of the aforementioned file operations. These iterations were
conducted while varying the size  of the set of elements kept in Protected-Paths. In particular, we
used 0, 10, 100, 200, 300, 400 and 500. Furthermore, we also varied the thread count (1, 2, 4, 8) to assess
the impact of concurrent file system operations intercepted and managed by VFSMon. In relation to
this aspect, we recall that concurrency is managed in VFSMon with the usage of read/write spinlocks,
in order to manage access to its internal structures. Hence, no blocking service is used.</p>
        <p>In all the tests each thread targets always the same file for performing the open(...) operation.
This choice has been motivated in order to gather latency samples related to a scenario where the device
blocks that keep data/metadata required for opening the file (e.g. for performing the lookup at the level
of the file system) are highly likely kept in the page-cache ofered by the Linux kernel. This allows
assessing the run-time cost by VFSMon in the scenario where actual I/O interactions with the device
hosting the file system are avoided (thanks to the page-cache), which allows a better characterization of
the potential intrusiveness of VFSMon operations.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Results</title>
        <p>Now we proceed to present the results for the aforementioned tests by illustrating the distribution of
operation times in terms of clock cycles across diferent thread counts and numbers of protected files.
All the tests we are going to describe have been carried out on a machine equipped with 12th Gen Intel
i7-12700H (10 VCPUs allocated to the used VM out of the 20 total of the host machine) @ 4.6GHz, and
8Gb (allocated out of the 16Gb of the host machine).</p>
        <p>In Figure 2 we report the latency of open operations in read-mode. Since in the access control carried
out by VFSMon checks are only triggered on write-mode opens, read operations experience negligible
overhead, even with an increasing number of protected files. The data indicates consistent median
read times across all configurations, with only minor diferences observed between the absence or
presence of our kernel module. We can then see the illustration of the latency of write-mode operations
in Figure 3 where, although access control checks are triggered, the overhead remains low due to the
fact that VFSMon employs a hashmap-based path-matching mechanism during its security checks,
which scales eficiently with the number of protected files. Lastly, in Figure 4 we present the results
for file creation operations. The create mode involves opening files with flags O_CREAT | O_TRUNC
| O_WRONLY, triggering both write-mode access control checks and additional file system operations.
This use case shows how the overhead by VFSMon is further reduced, given the larger amount of
intrinsic operations that are executed at the level of the actual file system, which leads to reduce the
percentage incidence of VFSMon operations.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions and Future Work</title>
      <p>In this paper, we introduced VFSMon, a path-based reference monitor that operates at the Virtual File
System layer to deliver a flexible and dynamically configurable security solution for Linux. By
combining selective write-access restrictions, time-based protection windows, and an embedded credential
mechanism, VFSMon addresses several critical shortcomings of traditional reference monitors, ofering
a more practical and fine-grained approach to safeguarding both file and device file access. In addition,
the novel concept of place-holding paths facilitates common data management workflows, such as
controlled backup generation and enforced file immutability over defined periods. Our evaluation
demonstrates that VFSMon achieves these enhancements at a reasonable performance toll with respect
to the Linux baseline. This makes it well-suited for environments where security requirements are high
but must remain adaptive to changing operational conditions. Future work includes extending policy
configuration options and integrating user-friendly management tools.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This work was supported by Agenzia per la cybersicurezza nazionale under the programme for
promotion of XL cycle PhD research in cybersecurity - CUP E83C24002600001. The views expressed
are those of the authors and do not represent the funding institution.</p>
      <p>This work was supported by the European Union - Next Generation EU under the Italian National
Recovery and Resilience Plan (NRRP), Mission 4, Component 2, Investment 1.3, CUP F83C22001690001,
partnership on “Telecommunications of the Future” (PE00000001 - program “RESTART”)
During the preparation of this work, the author(s) used WRITEFULL in order to perform Grammar and
spelling check. After using these tool(s)/service(s), the author(s) reviewed and edited the content as
needed and take(s) full responsibility for the publication’s content.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>W.</given-names>
            <surname>Stallings</surname>
          </string-name>
          ,
          <source>Cryptography and Network Security: Principles and Practice</source>
          , 5th ed.,
          <source>Prentice Hall</source>
          ,
          <year>2007</year>
          . URL: https://www.pearson.com, discusses
          <article-title>VPNs in the context of network security.</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M.</given-names>
            <surname>Bishop</surname>
          </string-name>
          , Introduction to Computer Security, Addison-Wesley,
          <year>2003</year>
          . URL: https://www.pearson. com,
          <article-title>covers authentication protocols and related topics in computer security</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Elkhail</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Lachtar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Ibdah</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Aslam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Khan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bacha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Malik</surname>
          </string-name>
          ,
          <article-title>Seamlessly safeguarding data against ransomware attacks</article-title>
          ,
          <source>IEEE Trans. Dependable Secur. Comput</source>
          .
          <volume>20</volume>
          (
          <year>2023</year>
          )
          <fpage>1</fpage>
          -
          <lpage>16</lpage>
          . URL: https://doi.org/10.1109/TDSC.
          <year>2022</year>
          .
          <volume>3214781</volume>
          . doi:
          <volume>10</volume>
          .1109/TDSC.
          <year>2022</year>
          .
          <volume>3214781</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <article-title>[4] Compliant worm storage using netapp snaplock</article-title>
          , https://www.netapp.com/pdf.html?item=/media/ 6158-
          <fpage>tr4526pdf</fpage>
          .pdf,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <article-title>[5] An overview of microsoft project silica and its archive use</article-title>
          , https://www.techtarget.com/ searchstorage/feature/
          <article-title>An-overview-of-Microsoft-Project-</article-title>
          <string-name>
            <surname>Silica-</surname>
          </string-name>
          and
          <article-title>-its-archive-</article-title>
          <string-name>
            <surname>use</surname>
          </string-name>
          ,
          <year>2024</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <article-title>[6] Write-once-read-many (worm) tamper proof technology</article-title>
          , https://www.nexusindustrialmemory. com/write-once
          <string-name>
            <surname>-</surname>
          </string-name>
          read-many/,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Smalley</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Vance</surname>
          </string-name>
          , W. Salamon,
          <article-title>Implementing selinux as a linux security module</article-title>
          ,
          <source>NAI Labs Report</source>
          <volume>1</volume>
          (
          <year>2001</year>
          )
          <fpage>139</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <article-title>[8] Enabling isg to interact with external policy servers</article-title>
          , https://www.cisco.com/c/en/us/td/docs/ ios-xml/ios/isg/configuration/xe-3s/asr1000/isg-xe
          <string-name>
            <surname>-</surname>
          </string-name>
          3s
          <string-name>
            <surname>-</surname>
          </string-name>
          asr1000
          <article-title>-book/isg-ext-pol-svrs</article-title>
          .pdf,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <article-title>[9] Crowd strike 2022 global threat report</article-title>
          , https://go.crowdstrike.
          <source>com/global-threat-report-2022</source>
          .html,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Kaspersky</surname>
            <given-names>security</given-names>
          </string-name>
          <source>bulletin</source>
          <year>2021</year>
          , https://securelist.com/ksb-2021/,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>A.</given-names>
            <surname>Continella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Guagnelli</surname>
          </string-name>
          , G. Zingaro,
          <string-name>
            <given-names>G. D.</given-names>
            <surname>Pasquale</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Barenghi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Zanero</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Maggi</surname>
          </string-name>
          ,
          <article-title>Shieldfs: a self-healing, ransomware-aware filesystem</article-title>
          , in: S. Schwab,
          <string-name>
            <given-names>W. K.</given-names>
            <surname>Robertson</surname>
          </string-name>
          , D. Balzarotti (Eds.),
          <source>Proceedings of the 32nd Annual Conference on Computer Security Applications, ACSAC</source>
          <year>2016</year>
          , Los Angeles, CA, USA, December 5-
          <issue>9</issue>
          ,
          <year>2016</year>
          , ACM,
          <year>2016</year>
          , pp.
          <fpage>336</fpage>
          -
          <lpage>347</lpage>
          . URL: http://dl.acm.org/citation. cfm?id=
          <fpage>2991110</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J.</given-names>
            <surname>Huang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Xing</surname>
          </string-name>
          , P. Liu,
          <string-name>
            <given-names>M. K.</given-names>
            <surname>Qureshi</surname>
          </string-name>
          , Flashguard:
          <article-title>Leveraging intrinsic flash properties to defend against encryption ransomware</article-title>
          , in: B.
          <string-name>
            <surname>Thuraisingham</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Evans</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Malkin</surname>
          </string-name>
          , D. Xu (Eds.),
          <source>Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, CCS</source>
          <year>2017</year>
          , Dallas, TX, USA, October 30 - November 03,
          <year>2017</year>
          , ACM,
          <year>2017</year>
          , pp.
          <fpage>2231</fpage>
          -
          <lpage>2244</lpage>
          . URL: https://doi.org/10.1145/3133956.3134035. doi:
          <volume>10</volume>
          .1145/3133956.3134035.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>P.</given-names>
            <surname>Caporaso</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Bianchi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Quaglia</surname>
          </string-name>
          , Vaultfs:
          <article-title>Write-once software support at the file system level against ransomware attacks</article-title>
          ,
          <source>arXiv preprint arXiv:2410.21979</source>
          (
          <year>2024</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <article-title>Fs-verity: read-only file-based authenticity protection</article-title>
          , https://docs.kernel.org/filesystems/fsverity. html,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>