Commit Graph
1662 Commits
Author SHA1 Message Date
Bill Zissimopoulos 97e6d92b5b sys: FspFsvolQueryDirectoryCopy
Correct bounds checking on FSP_FSCTL_DIR_INFO records.
2026-07-27 16:23:45 +03:00
Bill Zissimopoulos a744d6f24c sys: FspFsvolQueryStreamInformationCopy: fix vulnerability reported by Abhinav Agarwal (GitHub @abhinavagarwal07)
Correct bounds checking on FSP_FSCTL_STREAM_INFO records.
2026-07-27 16:19:10 +03:00
Bill Zissimopoulos 1916d9bf06 sys: FspVolumeNotifyWork: fix vulnerability reported by Wencheng Xue (GitHub @panwnvda)
Correct bounds checking on FSP_FSCTL_NOTIFY_INFO records.
2026-07-27 16:16:41 +03:00
Bill Zissimopoulos 83aa54b4ab sys: FspFsvolWriteCached: move CcCanIWrite outside the locks
This eliminates the deadlock described in PR #677 while at the same time
ensuring that CcDeferWrite is called after the file's cache map has been
initialized.
2026-07-11 14:05:26 +03:00
Bill ZissimopoulosandGitHub 169eb2c35d Merge pull request #669 from yeonsh/fix-notify-rename-selfdeadlock
sys: fix FileRenameResource self-deadlock between notify session and FspVolumeNotifyWork
2026-06-23 15:21:41 +03:00
Bill Zissimopoulos bd8b54c469 sys: FspVolumeNotify: fix integer overflow vulnerability
This vulnerability was reported by:
- Tay Kiat Loong (GitHub: @owl4444)
- uhg (GitHub: @UltimateHG)
2026-06-13 16:41:35 +03:00
yeonsh 82f59837f6 sys: fix FileRenameResource self-deadlock between notify session and FspVolumeNotifyWork
Under heavy concurrent rename + change-notification load a volume can
deadlock permanently: all renames (exclusive) and opens (shared) on the
volume block, freezing the mount.

FspFileSystemNotifyBegin (FspVolumeNotifyLock) acquires the per-volume
FileRenameResource shared via an owner pointer (&VolumeNotifyCount) and
holds it for the whole Begin/End session. If a rename queues as an
exclusive waiter mid-session, the asynchronous FspVolumeNotifyWork then
re-acquires the same resource shared with ExAcquireResourceSharedLite.
Due to ERESOURCE writer-priority that shared acquire blocks behind the
queued exclusive waiter (the worker thread is not the owner -- the owner
is the &VolumeNotifyCount pointer). But that work item is the one that
must process FspFileSystemNotifyEnd to drop VolumeNotifyCount to 0 and
release the session, so it can never run: the session lock is never
released and the rename waits forever, while VolumeNotifyCount runs away
as Begin keeps incrementing it.

Acquire the rename resource in FspVolumeNotifyWork with
ExAcquireSharedStarveExclusive instead. The enclosing Begin/End session
already holds the resource shared and already defers renames until End,
so granting this redundant shared acquire ahead of the queued exclusive
waiter preserves name-stability semantics while breaking the deadlock. A
real exclusive holder still blocks the starve-exclusive acquire, so
correctness is unchanged.
2026-06-05 22:48:47 +09:00
Bill Zissimopoulos 624f285452 update source copyright for 2026 2026-03-04 15:54:27 +02:00
Bill Zissimopoulos 6ab7532d5b Merge branch 'pvt-np-nolaunch' 2026-03-04 15:25:53 +02:00
Bill Zissimopoulos 7f82326454 sys: FspFastIoDeviceControl: add a couple of fixes
- Check that the operation succeeded prior to copying to the output buffer.
- Avoid information leaks by only copying what is necessary to the output
buffer (suggestion by Tay Kiat Loong).
2026-02-17 20:48:01 +02:00
Bill Zissimopoulos 13d306f586 sys: FspFastIoDeviceControl: check input/output buffer lengths 2026-02-17 17:07:28 +02:00
Bill Zissimopoulos ae40f0edb1 sys: FspFastIoDeviceControl: fix exploit reported by Tay Kiat Loong
The WinFsp "transact" protocol is used by user mode file systems to interface
with the FSD. This protocol works via the DeviceIoControl API and uses the
FSP_IOCTL_TRANSACT control code. The FSP_IOCTL_TRANSACT code is marked as
METHOD_BUFFERED.

When the DeviceIoControl call is forwarded as an IRP, the METHOD_BUFFERED flag
instructs the kernel to copy user mode buffers to kernel mode buffers (and
vice-versa). However when the DeviceIoControl call is forwarded via the FastIO
mechanism the METHOD_BUFFERED flag is ignored. This means that when WinFsp
added support for DeviceIoControl FastIO, the FSD started accessing user mode
buffers directly.

This means that a malicious file system could attempt exploits like changing
or freeing a buffer while the FSD is reading it. Tay Kiat Loong developed a
POC exploit which demonstrated this vulnerability.

This commit fixes the problem by patching FspFastIoDeviceControl to add the
missing METHOD_BUFFERED handling.
2026-02-17 15:21:35 +02:00
Bill ZissimopoulosandGitHub aed8bb745f Merge pull request #648 from chenjie4255/add_write_ea_perm
dll & fuse: Added "AddWriteEaPerm" mount option.
2026-02-05 12:07:23 +02:00
ethan 4dbea1f298 dll & fuse: Added "AddWriteEaPerm" mount option. 2026-02-05 12:09:19 +08:00
Bill Zissimopoulos f021496302 np: NPAddConnection: support file systems not managed by the launcher 2026-02-03 21:03:04 +02:00
ethan ccd75d7c47 remove outdated comments 2025-12-24 09:28:37 +08:00
ethan fbbb4c3de1 dll: add fuse directio flag support 2025-12-23 17:05:48 +08:00
Bill ZissimopoulosandGitHub 5b429bc445 Merge pull request #614 from chenjie4255/flush_on_cleanup
dll: Added FlushOnCleanup fuse param
2025-08-07 16:55:11 +03:00
ethan e4ceb9010b moved FlushOnCleanup from VolumeParam to struct fuse 2025-08-07 15:30:07 +08:00
coderall2andGitHub 7e861c30ac Fix: fix FspPosixMapPosixToWindowsPathEx pointer misuse 2025-07-02 13:30:12 +08:00
ethan c8e182e1d4 sys & dll: Added FlushOnCleanup volume param 2025-06-20 14:56:01 +08:00
Bill Zissimopoulos ddca7bd548 sys: driver.inf: PnpLockdown=1 2025-06-05 16:02:43 +01:00
Bill Zissimopoulos c8366af48c update source copyright for 2025 2025-05-15 20:33:31 +01:00
Bill Zissimopoulos a2cd6978be sys: CcDeferWrite fix 2025-05-15 12:46:00 +01:00
Bill Zissimopoulos d75e9f7ee6 sys: oplock fix 2025-05-08 21:47:06 +01:00
Bill Zissimopoulos 4fdec4d37f sys: FspFsvolCreate, FspFsvolSetSecurity: absolute security descriptors
Some third party filters send us security descriptors in absolute rather
than self-relative format. Handle this case by converting them to self-
relative format ourselves.
2024-10-10 12:34:04 +01:00
Bill Zissimopoulos 2bf9a6c16e sys: mup: correctly handle relative file object chain (#561) 2024-06-20 12:44:35 +01:00
Bill Zissimopoulos 7551193ad7 update source copyright to 2024 2024-01-08 12:38:44 +00:00
Bill Zissimopoulos 65bf8c5319 dll: use adaptive locks when starting/stopping FSD 2023-12-12 12:36:41 +00:00
Bill Zissimopoulos de321620fd dll: FspFsctlServiceVersion as public API 2023-08-30 11:17:09 +01:00
Bill Zissimopoulos a482183149 sys: FspPropagateTopFlags: check TopLevelIrp not completed
Add a check to verify that the TopLevelIrp has not been completed. This
became necessary because on recent Windows kernels, IRP's can have "IRP
extensions", which are freed when an IRP is completed. This can trigger
a recursive CLOSE with a top-level IRP that has been completed, which
can bugcheck the system.

Case in point: the new (Win11) NtCopyFileChunk creates IRP's with
COPY_INFORMATION attached. Upon completion of such an IRP the
SourceFileObject is freed, which results in a recursive IRP_MJ_CLOSE
with a completed top-level IRP, which would lead to a BSOD.
2023-08-29 13:15:37 +01:00
Bill Zissimopoulos db319bc3c1 sys,dll: mount improvements
- sys: FspFsvolFileSystemControl: FSCTL_IS_VOLUME_MOUNTED
- dll: mount: Transact0, FspMountNotifyShellDriveChange
2023-02-24 12:02:03 +00:00
Bill Zissimopoulos 97c075e744 sys: FspFsvolQueryDirectoryCopy: add missing continue
A single line change in FspFsvolQueryDirectoryCopy fixes GitHub issue #475.
This commit also includes a test for detecting duplicate directory entries.
Credit for the investigation and reproduction of this issue goes to GitHub
user @hach-que.
2023-02-16 17:07:59 +00:00
Bill Zissimopoulos 52e6aa97b5 build: sys: pacify hardware center validation
Infverif /k no longer likes "undecorated" [DefaultInstall] sections and
instead it wants them "architecture decorated". For example,
[DefaultInstall.ntarm64]. So play along to have our driver signed.

For more information see:
https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/creating-a-primitive-driver
2023-02-01 22:50:35 +00:00
Bill Zissimopoulos 3aadaee511 dll: FspFileSystemStopServiceIfNecessary 2023-02-01 17:42:11 +00:00
Bill Zissimopoulos ba5d52e9a5 dll: FspFileSystemStartDispatcher:
Send a Transact0 to inform the FSD that the dispatcher is almost ready.
2023-01-09 15:45:11 +00:00
Bill Zissimopoulos d626fb9563 sys: FspReleaseForModWrite
In some rare cases and under load the mapped page writer's TopLevelIrp
may be trashed by some outside component (observed on Windows 10 1909).

For this reason remove an assertion that could trigger in debug builds.
2023-01-09 15:30:42 +00:00
zeho11andGitHub e550e261f0 dll: fuse: correct error handling when name exceeds limit
Related to b62e1e920b
2022-12-12 12:08:48 +09:00
zeho11 db07b24342 Update 2022-12-08 18:02:19 +09:00
zeho11andGitHub cb81e81985 Update fuse_intf.c 2022-12-07 15:17:59 +09:00
zeho11andGitHub b62e1e920b dll: fuse: change name limit to 255 chars
Fixes #191
Fixes #455
2022-12-07 14:39:36 +09:00
Bill Zissimopoulos a2e92207c5 Merge branch 'master' into pvt-sxs 2022-10-07 12:10:20 +01:00
Bill Zissimopoulos be27a82879 dll: FspCreateDirectoryFileW
On Windows/ARM64 CreateFileW is no longer able to create directories
using the flags FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_POSIX_SEMANTICS.
The new FspCreateDirectoryFileW implements the same semantics and replaces
the previous CreateFileW call.
2022-10-07 11:47:25 +01:00
Bill Zissimopoulos 4f5ad93f00 Merge branch 'master' into pvt-sxs 2022-10-04 15:44:49 +01:00
Bill Zissimopoulos b9ca46694e sys: FspFileNodeRenameCheck: fix handle oplock break 2022-10-04 15:44:27 +01:00
Bill Zissimopoulos d1fc5e5d0f Merge branch 'pvt-vpb2' into pvt-sxs-vpb 2022-10-03 15:10:06 +01:00
Bill Zissimopoulos 7f73192f8d sys: FspVolumeCreate
If we have an fsvrt device, mount it via opening the volume.
This ensures that the fsvrt is mounted by the correct fsvol
device early on and remedies a rare case where NTFS crashes
the system when it attempts to mount our fsvrt.
2022-10-02 20:10:32 +01:00
Bill Zissimopoulos c4ecd15c0a Merge branch 'master' into pvt-sxs 2022-10-02 17:49:47 +01:00
Bill Zissimopoulos d71049225e sys: FSP_DEVICE_EXTENSION: remove unused SiloContainerId 2022-10-02 17:35:07 +01:00
Bill Zissimopoulos 91d7f3b673 sys: FspSiloInitialize: always initialize FspSiloList and Mutex 2022-10-01 21:08:01 +01:00