1
0
mirror of https://github.com/winfsp/winfsp.git synced 2026-05-01 02:49:15 -05:00
Commit Graph

1650 Commits

Author SHA1 Message Date
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 Zissimopoulos 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
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 Zissimopoulos 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
coderall2 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
zeho11 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
zeho11 cb81e81985 Update fuse_intf.c 2022-12-07 15:17:59 +09:00
zeho11 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
Bill Zissimopoulos 63e23c2039 fsptool: load command 2022-10-01 14:55:30 +01:00
Bill Zissimopoulos 4d1594b1cf sys: silo: ensure FspSiloListMutex in critical region 2022-10-01 14:44:17 +01:00
Bill Zissimopoulos 0eb6912296 sys: FspSiloEnumerate, FspDriverFinalizeDevicesForUnload 2022-10-01 10:47:18 +01:00
Bill Zissimopoulos c237a55951 Merge branch 'master' into pvt-sxs 2022-09-29 17:00:10 +01:00
Bill Zissimopoulos a3765d6360 sys: silo: FspSiloPostInitialize 2022-09-27 19:55:08 +01:00
Bill Zissimopoulos e8cec5dfc1 Merge branch 'master' into pvt-sxs 2022-09-26 17:42:30 +01:00
Bill Zissimopoulos ea189c5b68 dll: fuse: fix mountmgr directory mount points under Cygwin 2022-09-26 15:26:34 +01:00
Bill Zissimopoulos 1723179430 dll: FspFsctlStartService: fix bug in non-SxS mode 2022-09-10 17:14:19 +01:00
Bill Zissimopoulos 2fc2c237d3 dll: FspFsctlEnumServices 2022-09-10 16:23:14 +01:00
Bill Zissimopoulos b99fb9a5cb dll: FspFsctlRegister: sxs-ize driver display name 2022-09-09 23:57:44 +01:00
Bill Zissimopoulos b43d1f5502 dll: FspFsctlUnregister: do FspFsctlStopService prior to unregister 2022-09-07 14:20:20 +01:00
Bill Zissimopoulos 90acd19014 sys: FspDeviceDelete: remove DBG code
FspDeviceDelete was recently changed and its DBG code is no longer valid.
2022-09-04 16:58:38 +01:00