Commit Graph

335 Commits

Author SHA1 Message Date
Mounir IDRASSI
b6744b8ed5 Increment version to 1.26.28 2026-04-30 13:39:51 +09:00
Mounir IDRASSI
a9b1d5ce57 Windows: Harden Windows driver input validation
Validate SecRegion password cache offsets before use.
Wipe decrypted SecRegion password-cache data even when cache validation fails.
Clamp encrypted I/O work item counts and check allocation sizing.
Reject invalid boot drive sector writes and initialize decoy wipe data unit.
Validate hidden-system boot offsets and remap arithmetic before use.
2026-04-26 18:42:26 +09:00
Mounir IDRASSI
357ce6bd7a macOS: harden FUSE-T SMB metadata handling
Increase advertised metadata file size, broaden hdiutil path normalization, and make auxiliary device info updates atomic.
2026-04-22 23:20:25 +09:00
Mounir IDRASSI
deb7f55bfb macOS: stabilize FUSE-T SMB mount metadata
Make /aux-device-info readable for SMB, verify that FUSE records hdiutil device info after mount and recover missing virtual devices from hdiutil before dismounting auxiliary mounts.
2026-04-22 16:32:10 +09:00
Mounir IDRASSI
4271b8e6f5 macOS: stabilize FUSE-T SMB auxiliary mounts
Add statfs metadata for the auxiliary FUSE mount, keep /control read-only by sending hdiutil device data through /aux-device-info and tolerate delayed SMB rediscovery during mount completion. Log final control-file retry failures for diagnostics.
2026-04-22 14:37:57 +09:00
audriusbuika
f63c617431 Fix hibernation crash on fresh Windows 11 25H2 (BSOD Event 41) (#1671)
* Fix hibernation crash on fresh Windows 11 25H2 (BSOD Event 41)

* follow up on the hibernation fix review: fix MDL check order and drop the risky sleep.
2026-04-15 09:22:46 +09:00
Mounir IDRASSI
250a488a84 macOS: Use SMB backend for FUSE-T auxiliary mounts 2026-04-14 14:42:36 +09:00
Mounir IDRASSI
cdc00dc4aa Linux: add support for building against FUSE3 2026-04-13 09:43:22 +09:00
Mounir IDRASSI
b1007c6135 Increment version to 1.26.27. Update Release notes, Windows driver, bootloader 2025-09-21 11:56:50 +09:00
Mounir IDRASSI
a7ebddc5f3 Windows driver: enhance IRP completion by avoiding inline ones and using CriticalWorkQueue for faster completion dispatch
This change adds more robustness in low memory case and avoid freezes.
It also protects cancel handling with cancel spin lock
2025-09-17 04:51:57 +09:00
Mounir IDRASSI
e4e6b167e2 Windows driver: add safe MapIrpDataBuffer function to prevent rare BSOD when irp->MdlAddress is NULL
Introduce MapIrpDataBuffer to handle Direct/Buffered/Neither I/O, probing & locking pages and allocating a temp MDL when needed.
Replace blind MmGetSystemAddressForMdlSafe usage. clean up TempUserMdl in OnItemCompleted to avoid crashes when MdlAddress is NULL.

Issue reported at https://sourceforge.net/p/veracrypt/discussion/technical/thread/e43bde8d86/
2025-09-15 14:34:22 +09:00
Mounir IDRASSI
f257d7b4a5 Windows driver: revert to single completion thread until proper implementation is in place 2025-09-15 11:25:05 +09:00
Mounir IDRASSI
f380dc13d9 Windows driver: fix VERIFY/TRIM offset & validation, label handling, CPU group affinity, and cleanup
- Use local volumeOffset, correct IOCTL_DISK_VERIFY & TRIM range translation/validation
- Enforce DataSetRangesLength alignment & per-range sanity checks
- Add missing returns after PsTerminateSystemThread
- Remove obsolete PsDereferenceImpersonationToken dynamic lookup
- Correct wide string size usage & zero label info buffer
- Fix DEBUG_TRACE macro check and GetCpuGroup off-by-one. proper affinity mask
- Minor safety/clarity cleanups
2025-09-13 23:26:12 +09:00
Mounir IDRASSI
54b81ed2d1 Windows driver: add defensive checks to TCCloseVolume implementation 2025-09-13 15:26:53 +09:00
Mounir IDRASSI
0b60d2a119 Windows: remove wrong static declaration of functions in Ntvol.h 2025-09-13 15:25:56 +09:00
Mounir IDRASSI
02e7b48836 Windows driver: revert IRP completion overhaul changes until more tests are conducted 2025-09-13 15:08:38 +09:00
Mounir IDRASSI
f6f25eec8f Windows driver: simplify TCSleep to use KeDelayExecutionThread
Replace timer-based TCSleep (which allocated a KTIMER and waited on it) with an
implementation that calls KeDelayExecutionThread. This removes dynamic allocation
and kernel timer usage to simplify the code and reduce resource overhead.
Adds an IRQL <= APC_LEVEL assertion and documents the requirement.

This is safe because TCSleep is always called from code that runs at PASSIVE_LEVEL
2025-09-08 12:14:20 +09:00
Mounir IDRASSI
7df2c2957f Windows driver fix: Decrement IoThreadPendingRequestCount on allocation failure in MainThreadProc
Added InterlockedDecrement in the error path when GetPoolBuffer fails for EncryptedIoRequest to ensure accurate tracking of pending IO requests and prevent potential resource leaks.
2025-09-08 11:40:33 +09:00
Mounir IDRASSI
f40f316dfb Windows driver: remove unneeded __try/__finally 2025-09-08 11:38:30 +09:00
Mounir IDRASSI
0e19cb9223 Windows driver: harden UpdateBuffer against integer overflow. Make completion backoff per request (no shared state) 2025-09-08 10:36:18 +09:00
Mounir IDRASSI
062b385a69 Windows driver: overhaul IRP completion path in EncryptedIoQueue, add dual completion threads, precise byte accounting & safer UpdateBuffer
Major changes:
- Added pooled + elastic work item model with retry/backoff (MAX_WI_RETRIES). removed semaphore usage.
- Introduced two completion threads to reduce contention and latency under heavy IO.
- Added BytesCompleted (per IRP) and ActualBytes (per fragment) for correct short read/write accounting. total read/write stats now reflect real transferred bytes instead of requested length.
- Moved decryption of read fragments into IO thread. completion threads now only finalize IRPs (reduces race window and simplifies flow).
- Deferred final IRP completion via FinalizeOriginalIrp to avoid inline IoCompleteRequest re-entrancy. added safe OOM inline fallback.
- Implemented work item pool drain & orderly shutdown (ActiveWorkItems + NoActiveWorkItemsEvent) with robust stop protocol.
- Replaced semaphore-based work item acquisition with spin lock + free list + event (WorkItemAvailableEvent). added exponential backoff for transient exhaustion.
- Added elastic (on-demand) work item allocation with pool vs dynamic origin tracking (FromPool).
- Added FreeCompletionWorkItemPool() for symmetric cleanup; ensured all threads are explicitly awakened during stop.
- Added second completion thread replacing single CompletionThread.
- Hardened UpdateBuffer: fixed parameter name typo, added bounds/overflow checks using IntSafe (ULongLongAdd), validated Count, guarded sector end computation.
- Fixed GPT/system region write protection logic to pass correct length instead of end offset.
- Ensured ASSERTs use fragment‑relative bounds (cast + length) and avoided mixed 64/32 comparisons.
- Added MAX_WI_RETRIES constant. added WiRetryCount field in EncryptedIoRequest.
- Ensured RemoveLock is released only after all queue/accounting updates (OnItemCompleted).
- Reset/read-ahead logic preserved. read-ahead trigger now based on actual completion & zero pending fragment count.
- General refactoring, clearer separation of concerns (TryAcquireCompletionWorkItem / FinalizeOriginalIrp / HandleCompleteOriginalIrp).

Safety / correctness improvements:
- Accurate short read handling (STATUS_END_OF_FILE with true byte count).
- Eliminated risk of double free or premature RemoveLock release on completion paths.
- Prevented potential overflow in sector end arithmetic.
- Reduced contention and potential deadlock scenarios present with previous semaphore wait path.
2025-09-07 23:58:35 +09:00
Mounir IDRASSI
55adda7504 Windows driver: add more checks and comments to crash dump filter
- Document HIGH_LEVEL constraints and rationale for pre-building a nonpaged scratch MDL.
- Allocate contiguous scratch buffer with conservative PFN cap (0x7FFFFFFFFFF) and fall back to unlimited cap if needed.
- Replace ASSERT with TC_BUG_CHECK for validation of write MDL mapping at HIGH_LEVEL.
- Safely copy PFNs from prebuilt MDL into caller MDL: compute dst/src page counts, check capacity, copy exact PFNs and retarget MDL header fields (preserve MdlFlags).
- Make DumpData cleanup defensive in unload path.
- comments improvements for clarity and maintainability.
2025-09-06 16:42:42 +09:00
Charlie
c1ae011ba1 Fix problems inside crash dump filter path (#1590)
* Prefer allocations to be non-executable
* Remove and reimplement DDIs inappropriately called inside HIGH_LEVEL IRQL routines
* Refactor hibernate context to be passed around in the passed FILTER_EXTENSION pointer rather than global
2025-09-06 11:22:50 +09:00
Mounir IDRASSI
54c39e4eb2 Use "KDF" instead of "PKCS5 PRF" for UI selection of KDF to use 2025-08-08 22:53:04 +09:00
Mounir IDRASSI
3867c1cca3 Use blake2b as hash for random generator from Argon2 is used. 2025-07-03 17:32:47 +09:00
Mounir IDRASSI
eadb02d8ef Windows: set version to 1.26.26. Update Release Notes, bootloader and Windows drivers. 2025-06-29 23:31:18 +09:00
Mounir IDRASSI
ab2937c889 Add new entry in XML files for Argon2 memory cost. Increment version to 1.26.25 2025-06-25 20:32:09 +09:00
Mounir IDRASSI
3c17b8ced2 Windows: Add support for Argon2id as an alternative to PBKDF2 key derivation 2025-06-25 15:44:31 +09:00
Mounir IDRASSI
08c813efd6 Increment version to 1.26.24. Update Release Notes and Windows drivers. 2025-05-29 18:10:59 +09:00
Mounir IDRASSI
e68c98ab6b Increment version to 1.26.3. Update Release Notes and signed drivers 2025-05-28 19:28:32 +09:00
Mounir IDRASSI
4b46d992da Increment version to 1.26.22. Update Release Notes. Update signed drivers. 2025-05-25 09:49:49 +09:00
Mounir IDRASSI
44a9f8bcff Remove SM4 support! 2025-05-18 18:31:39 +09:00
Mounir IDRASSI
cf5a0ad003 Update Release Notes.html and release date. 2025-05-16 15:41:10 +09:00
Mounir IDRASSI
acac37b5b7 Update Release Notes and CHM. Set release date and update signed Windows drivers. 2025-05-12 10:21:58 +09:00
Mounir IDRASSI
b673901503 Move copyright and links to "AM Crypo", amcrypto.jp and veracrypt.jp 2025-05-11 16:02:20 +09:00
Mounir IDRASSI
bbc9fbf175 Increment version to 1.26.21 2025-05-04 03:43:45 +09:00
Mounir IDRASSI
7924f06e39 Initial support of SM4 cipher for normal volumes 2025-05-04 02:27:05 +09:00
Bernard Ladenthin
5eb358ca18 Refactor: Use symbolic constants for volume header magic numbers (#1525)
Replaced hardcoded 0x56455241 ('VERA') with TC_HEADER_MAGIC for better readability and maintainability.
Also replaced 0x5645524142455854 with TC_BOOT_DRIVE_FILTER_EXTENSION_MAGIC and added 'ULL' suffix for 64-bit safety.
2025-04-21 11:24:02 +02:00
Mounir IDRASSI
2180020cee Windows driver: Fix regression that always allowed defragmentation and caused other side effects
Now we properly honor the AllowDefrag configuration.

This regression introduced other issues because, in order to allow defragmentation, we must provide Windows with an actual physical disk number. As a result, we assign the number of the physical disk where the VeraCrypt volume resides. This, in turn, causes Windows to send IOCTLs directly to this disk instead of to VeraCrypt. If these IOCTLs return values and properties not supported by VeraCrypt, inconsistencies arise, leading to failures.
2025-02-04 00:02:08 +01:00
Mounir IDRASSI
e73ea7193e Widnows driver: use correct value for HiddenSectors field in structures to match read MBR disks 2025-02-03 23:48:51 +01:00
Mounir IDRASSI
55563ffe42 Increment version to 1.26.20. Update Release Notes. 2025-02-03 17:52:19 +01:00
Mounir IDRASSI
c69ba240c4 Complete replacement of Dismount references by Unmount in various files 2025-02-02 23:37:36 +01:00
Helmut K. C. Tessarek
498dff9013 refactor: use the term unmount instead of dismount (#1478)
* refactor: use UNMOUNT instead of DISMOUNT in code

This change updates the term DISMOUNT in constants to UNMOUNT.
Other occurrences (e.g. variable names) are left alone for now.

* refactor(ui): use unmount instead of dismount

This change updates the GUI text and replaces dismount with unmount.

* docs: update term dismount -> unmount

* refactor(cmdline): add unmount

This change adds an argument 'unmount' for command line usage, while
trying to deprecate the old disnount argument.
The current dismount argument/flag will still work to not introduce
a breaking change.

* docs: mention that /dismount is deprecated

This change fixes the shorthand version of the argument /unmount
It also adds back the info for /dismount and that it is deprecated.
2025-01-31 23:18:26 +01:00
Mounir IDRASSI
247c98d954 Implement SHA256 acceleration on ARM64 platforms using CPU instructions 2025-01-26 16:21:13 +01:00
Mounir IDRASSI
16aa1a7be0 Increment version to 1.26.19. Update Release Notes. 2025-01-22 18:37:46 +01:00
Mounir IDRASSI
ff63e5aad0 Update Release Notes. Set version to 1.26.18. Update signed Windows drivers. 2025-01-17 07:44:09 +01:00
Mounir IDRASSI
54bd819990 Windows/Linux/macOS: implement AES hardware support on ARM64 (ARMv8) 2025-01-17 00:58:54 +01:00
Mounir IDRASSI
1b35abb191 Increment version to 1.26.18. Update copyright date. Update Release Notes. Update Windows drivers. 2025-01-14 12:26:28 +01:00
Mounir IDRASSI
f3af65b007 Windows driver: Use IO_DISK_INCREMENT for event signaling in IRP completion routine
This provides a slight priority boost for waiting threads and maintains standard practice for disk device drivers.
2024-12-25 17:58:12 +01:00
Mounir IDRASSI
81f0adcc35 Windows Driver: set Windows 10 version 1809 as minimum.
To support this, we had to replace ExAllocatePool2 by ExAllocatePoolUninitialized.
2024-12-25 16:18:19 +01:00