Commit Graph
26 Commits
Author SHA1 Message Date
Alexandr Stelnykovych 0fd3665ac0 kext: fast-track split-tunnel proxy packets on loopback
Add PM_SPLIT_TUN_PORT (719) to fast_track_pm_packets so that redirected
packets arriving at the local split-tunnel proxy are permitted immediately
by the kext, matching the existing behaviour for the SPN port (717) and
the DNS port (53). This prevents internal proxy connections from being
reported to Portmaster and appearing in the connection monitor UI.

Also simplify fast_track_pm_packets by removing the redundant
match-on-direction branches, which were identical for Outbound and
Inbound.

Bump kext interface patch version to 2.1.1.0.
2026-05-07 13:46:16 +03:00
Alexandr Stelnykovych 6fd5c72b88 Merge pull request #2137 from safing/feature/kext-improvements
feat(windows-kext): owner PID tracking, downstream filter bypass, and split-tunneling routing support
2026-03-10 14:23:00 +02:00
Alexandr Stelnykovych 3b0b1745dc Merge pull request #2136 from safing/fix/windows-kext-bsod
fix(windows-kext): fix potential BSODs and block verdict bypass in WFP callouts
2026-03-10 14:20:23 +02:00
Alexandr Stelnykovych 0615270807 Update packet_callouts.rs
Added a comment for the recalc_header_checksums() call.
2026-03-10 14:02:45 +02:00
Alexandr Stelnykovych baf436c205 refactor(device): improve comments for clarity on event queue and caches in Device struct 2026-03-06 10:26:29 +02:00
Alexandr Stelnykovych d11b0ee763 feat(kext): bypass downstream filters for Portmaster's own outbound connections
When a permitted connection is initiated by Portmaster itself, clear the
write flag on the classify result so subsequent filters in the sublayer
chain cannot override the permit action.
2026-03-05 15:32:32 +02:00
Alexandr Stelnykovych 13f85929b2 feat(kext): track owner PID of connected user-space process
Add IRP_MJ_CREATE and IRP_MJ_CLEANUP handlers to capture and clear the
PID of the user-space process that holds the device handle open.

- wdk/ffi: expose PsGetCurrentProcessId kernel API
- wdk/irp_helpers: add CreateRequest and CleanupRequest wrappers
- driver/device: add owner_pid AtomicU32 field with lock-free access
  for callouts; add is_owner_pid() helper
- driver/entry: register driver_create/driver_cleanup dispatch routines
  that store/clear owner_pid on connect/disconnect
2026-03-05 14:54:11 +02:00
Alexandr Stelnykovych 78fce7650d feat(kext): add RedirectSplitTunnel verdict support
Add Verdict::RedirectSplitTunnel (11) with PM_SPLIT_TUN_PORT redirection.
Wire up the new verdict in ALE, packet, and device layers alongside the
existing redirect verdicts. RedirectSplitTunnel is kept last in the enum
so older Portmaster versions (which only know verdicts 0–10) remain
unaffected.
2026-03-05 14:11:21 +02:00
Alexandr Stelnykovych 35ecee89d5 fix(kext): prevent block verdicts from being overridden by downstream WFP filters
Rename action_block() to action_block_hard(), which additionally calls
clear_write_flag(). This prevents lower-weight filters in the same WFP
sublayer from overwriting a block action set by Portmaster's callout.

Updated call sites:
- ALE layer: PermanentBlock, Undeterminable, Failed, and inbound Block
- Packet layer: PermanentBlock
2026-03-03 18:15:47 +02:00
Alexandr Stelnykovych 489b9c0442 fix(kext): replace global device pointer with AtomicPtr for thread safety 2026-03-03 13:33:04 +02:00
Vladimir Stoilov 04f8708448 Fix packet callout injection 2026-01-26 21:03:25 +02:00
Vladimir Stoilov f5072fd838 [kext] Fix compiler warnings 2025-06-10 09:49:10 +03:00
Vladimir Stoilov 10f2ef426e [kext] Resolve verdict of pending conn on shutdown 2025-06-09 20:11:26 +03:00
Vladimir Stoilov fe070b4f56 Feature/kext default action drop (#1747)
* [windows_kext] Make default action to drop

* [windows_kext] Minor improvments
2024-11-25 14:03:35 +02:00
Vladimir Stoilov af3bb804bf Fix reading only the needed TCP/UDP header bytes (#1730)
* [windows_kext] Fix reading only the needed TCP/UDP header bytes

* [windows_kext] Disable debug mode

* [windows_kext] Block all fragment packets

* [windows_kext] Improve wording for compiler error
2024-11-07 15:52:26 +02:00
Vladimir Stoilovandcoderabbitai[bot] 355f74318d [service] Fix check for invalid kext handle (#1716)
* [service] Fix check for invalid kext handle

* [windows_kext] Use BTreeMap as cache structure

* [windows_kext] Fix synchronization bug

* Update windows_kext/kextinterface/kext_file.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update windows_kext/kextinterface/kext_file.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update windows_kext/kextinterface/kext_file.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-10-16 12:19:08 +03:00
Vladimir Stoilov 89657123ec [windows_kext] Remove warning to reduce confusion. 2024-07-01 10:28:39 +03:00
Vladimir Stoilov 81bee82b8f [windows_kext] Update windows-rs 2024-06-28 16:06:30 +03:00
Vladimir Stoilov 2d9d433945 [windows_kext] Improve callouts description 2024-06-28 16:03:12 +03:00
Vladimir Stoilov db49f9a32d [windows_kext] Add check for previously injected packets in the ALE layer 2024-06-12 18:08:46 +03:00
Vladimir Stoilov 916a83a2a0 [windows_kext] Update docs and few minor fixes 2024-06-05 15:22:45 +03:00
Vladimir Stoilov 1730250a86 [windows_kext] Remove inbound ALE layer 2024-06-05 14:57:22 +03:00
Vladimir Stoilov 9fe140bd02 [windows_kext] Fix clippy warnings 2024-06-04 14:55:29 +03:00
Vladimir Stoilov b72cf2577a [windows_kext] Fix ALE layer TCP conn pend 2024-06-04 14:47:56 +03:00
Vladimir Stoilov 1d6228ea7b [windows_kext] fix all linter error 2024-05-16 16:21:27 +03:00
Vladimir Stoilov b0f664047b Add rust kext to the mono repo 2024-04-29 17:04:08 +03:00